A Practical Guide to SharePoint 2013

A Practical Guide to SharePoint 2013
A Practical Guide to SharePoint 2013 - Book by Saifullah Shafiq
Showing posts with label SQL Server. Show all posts
Showing posts with label SQL Server. Show all posts

Thursday, September 22, 2011

SQL SERVER – Learning SSAS (SQL Server Analysis Services) Online in 6 Hours – Top Down Designing and Bottom Up Designing (Via pinaldave)

Extracted from the original post

Those who are following me on Twitter and Facebook know that recently I am reenforcing my own concept for SQL Server Analysis Services (SSAS). Like many of us, I worked with Analysis Services in early years. In an earlier job, I got many projects for relational database performance tuning and over time, I lost touch with SSAS. This does not mean that I forgot all of the concepts but the ‘real’ hands-on experience was gathering dust. Looking back at the last five years, I realized that I have deep experience with relational performance tuning but there are a few new things which I have yet to explore and learn.

My Learning

One weekend I decided to learn SQL Server Analysis Services. I woke up early in the morning at 6 AM and by 7 AM I was sitting with coffee at my dual screen monitor computer. I had a free subscription to Pluralsight so on one screen I turned on their Analysis Services Fundamentals course. This course is well organized and I attended first six modules by 1 PM. After having a quick lunch with my family, I reviewed all the tasks and lessons given in the course. As it was the weekend and I had properly digested all the concepts, I decided to continue the remaining four modules the next day. The next day, the same routine: I followed and finished all the remaining modules along with the exercises. At the end of six hours of video learning and practicing for more than 8 hours, I felt very comfortable with the subject. I re-discovered my knowledge of SSAS which I used to practice a few years ago, before I opted for performance tuning.

For complete post, click here


Wednesday, September 14, 2011

Data Storage Changes for SharePoint 2010(Via SharePoint blog team)

Extracted

“Today we are announcing two related changes to the way we describe data storage in SharePoint. First, by taking advantage of performance and reliability improvements in SP1 and by defining specific requirements for large data storage in SharePoint, Microsoft is able to increase the supported limits for data storage in SharePoint.

Additionally, we are announcing that the SQL Server FILESTREAM RBS provider is now supported for use with SharePoint so that lower cost iSCSI connected NAS disk can be used. This post outlines the new data storage support limits and guidelines for scaling to those limits and it defines RBS including the new FILESTREAM RBS provider.”

Complete post here.

Wednesday, August 17, 2011

Technical highlights in Microsoft Dynamics AX 2012(Via Jolann van Dyk)

Extract from the original post "I’ve had the privilege of working with Microsoft Dynamics AX2012 for a number of months before the 1st August general release date. I helped build the demo system used by Steve Ballmer at the Convergence launch in April (you can read about the demo here), and I’m busy implementing the system in a customer situation at the moment. Suffice to say, I’ve had enough time to note down a list of technical highlights in the latest release, and I thought it’d be only fair to share them."

Complere blog post here.


Data Storage Changes for SharePoint 2010 (Via SharePoint Team Blog)

Extrat from the original post "Today we are announcing two related changes to the way we describe data storage in SharePoint. First, by taking advantage of performance and reliability improvements in SP1 and by defining specific requirements for large data storage in SharePoint, Microsoft is able to increase the supported limits for data storage in SharePoint.

Additionally, we are announcing that the SQL Server FILESTREAM RBS provider is now supported for use with SharePoint so that lower cost iSCSI connected NAS disk can be used. This post outlines the new data storage support limits and guidelines for scaling to those limits and it defines RBS including the new FILESTREAM RBS provider."

For complete post feel free to click here.



Sunday, August 6, 2006

SharePoint, Document Library, and SQL Server

I recently published an article on developerfusion.co.uk. Here is the link:

http://www.developerfusion.co.uk/show/5613/

Document Libraries are collections of files that you can share with team members on a web based on Windows SharePoint services. Want to know more about Document Libraries?? Read more about Document Libraries on this site:

http://office.microsoft.com/en-au/assistance/ha011412871033.aspx  

This link will show you how to create and use a document library. You can extend the functionality of these document libraries by using the "Event Handler Toolkit" that can be downloaded from the Microsoft site:

http://www.microsoft.com/downloads/details.aspx?familyid=4B2C2F1B-D74A-482A-903A-45BB44C5DEC4&displaylang=en

Read more on http://www.developerfusion.co.uk/show/5613/

Regards,

SSA

Tuesday, January 3, 2006

Populating InfoPath fields with SQL data (using managed code)

I know it's easy to populate InfoPath form fields with SQL data using data connections but there are certain scenarios where you may want to populate fields with SQL data using custom code. For example, consider a scenario where you form has different sections, and each section is filled with data from a different database. One way is to create multiple data connections in your form. The other way is to write custom code. This is not the only example, there can be different situations where writing your own code could prove useful. Another situation is when you want to validate data entered by a user. Simply, open a connection to your database and check the field's value against data in your database.
1. Create an InfoPath form and add a field and a button.
2. Field name is  "field1" which is the default name for a newly added field. You may want to change it to a name of your liking, for example, First Name, Last Name, Address, etc.
3. Double click the button (default name for the button is Ctrl_1) and select "Edit Form Code..." in the dialog box that opens.
4. Add following code in the click event of the button:
SqlConnection MyConnection = new SqlConnection("server=sqlserver;database=yourdatabase;UID=;PWD=;");
MyConnection.Open();
SqlCommand Cmd = new SqlCommand();
Cmd.Connection = MyConnection;
Cmd.CommandType = CommandType.Text;
Cmd.CommandText = "select * from tblUser";
SqlDataAdapter DA = new SqlDataAdapter(Cmd);
DataSet DS = new DataSet();
DA.Fill(DS);

thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1").text = DS.Tables[0].Rows[1][1].ToString();

if(DS.Tables[0].Rows[1][1].ToString() == "John Doe")
{
thisXDocument.UI.Alert("User name is John Doe.");
}
Code explanation:
Open a connection to the database using a connection string. Connection string contains your sql server, database name and userid and password to access the database. Open the connection before making any transaction. Add your sql query in the command object:
Cmd.CommandText = "select * from tblUser";
Following line will add data from SQL DB to your form field:
thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1").text = DS.Tables[0].Rows[1][1].ToString();
"field1" is your field's name. In the line above, we are populating this field with Row 1, Column 1 of the table.
if(DS.Tables[0].Rows[1][1].ToString() == "John Doe")
{
    thisXDocument.UI.Alert("User name is John Doe.");
}
If DB field is equal to "John Doe" then display a message to the user.
You can also do the opposite, instead of populating a field with DB data, get a value from the form field and find a record against this value in the DB. You just need to pass the form field value in the sql query:
 Cmd.CommandText = "select * from tblUser where username='" + thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1").text + "'";
Don't forget to add following namespaces in your code page:
using System;
using System.Data;
using System.Data.SqlClient;

Add following code to the project class:

public class InfoPathDBProject
{
    private XDocument thisXDocument;
    private Application thisApplication;

    public void _Startup(Application app, XDocument doc)
    {
        thisXDocument = doc;
        thisApplication = app;
    }

    //Application code

}


-SSA

Monday, October 10, 2005

SQL Server: Detach and Attach a DB

Target Audience: Beginners
Keywords: SQL Server, Attaching Databases
This post is not related to SharePoint directly but yes indirectly it is still related to SharePoint. I do lots of applications for SharePoint. I create custom built solutions in .NET for SharePoint. I don't like the back up utility of SQL Server. It is not reliable as it misses several stored procedures when restoring. Although it does not happen always but no body likes to take chances so i usually back up my database by detaching the db and saving the .MDF file to the back up folder. I also use the same mechanism for replicating the DB. Some times when you get stuck when attaching the detached DB. For example, consider this scenario. I want to replicate a DB. I detach the original DB and make a copy of it and rename it. I attach the original DB without any problem but when i try to attach the renamed DB copy, I get an error. This is not a technical solution to a problem as problem itself does not exist :) This is a very simple tip but many users will find it very useful. Believe me. When you are in a hurry to do a replication and could not find the solution, this tip will really come in very handy. Anyway, here are the steps involved:
1. Right click Databases. All Tasks > Attach Database.
2. Browse to find the renamed DB file (the MDF file).
3. Under "Current File(s) Location", double click the file name and change it to the new name. The box shows you the original MDF file name even though you have renamed it. Rename it and DO NOT HIT THE ENTER BUTTON. Instead, use your mouse and click somewhere in the second row. When you hit the enter button, SQL Server does not accept your change and reverse the file name back to the original file name but when you move your focus away from first row to second row by simply clicking the mouse, this problem does not occur.
4. "Attach As" also will still be showing the original file name. Type in the new name that you want to give to your database.
5. Specify the database owner and you are done.
Very simple! What's the big deal in it? Yes, what's the big deal in it? If you are a senior DBA reading this post and laughing and thinking why i am posting such a simple thing then let me tell you you were not the intended audience for this post. This happens with me very frequently. People criticize me for posting simple solutions but let me tell you that my goal is to write for every one, not just for the senior people. Most of the emails that i daily receive are from the young people are still learning the tricks of the trade. We can not ignore them or move away instead of helping them. Well, it gives me pleasure when a senior person appreciates my work but it equally pleases me when a beginner takes advantage of my simple tips and praises my work and thank me for writing it. So, getting back to the tip, here is one final note. If you get an error while attaching the DB without any apparent reason, see if your SQL query analyzer is open and you are accessing the DB in it. Some times, it happens that you are working in Query Analyzer, you leave the session open and detach the DB, for any purpose, be it taking backup or replication, when you try to re-attach the DB, you get an error telling you that attaching failed!! You don't see any reason why your attaching failed. This happens because of the open sessions in your Query Analyzer. Close the session by closing the Analyzer and try attaching the DB again.
Visit the following link to see how to attach a DB using T-SQL:


-SSA