Database Reference
In-Depth Information
Figure 1-1. Services window showing SQL Server service running
8. Please note the name in the parentheses (your SQL instance name). This might
be different from machine to machine; hence, it is important to know the SQL
instance name before you connect with it to continue working with SQL
Server. If you have multiple versions of SQL Server, then multiple SQL Server
Services will be listed, and you will be required to know your SQL Server 2012
instance name that you want to use.
9. If the SQL Server service is not running, then you can manually start it by right-
clicking and choosing Start. Your service should be then listed as Started under
Status. You must have this service running before you perform any database-
related operation.
Again, you need to remember the SQL Server instance name you used during this installation so you
can smoothly connect to and build database applications.
Because SQL Server 2012 doesn't come with a sample database, you need to install and configure
the sample databases separately. The next section talks about installing and configuring the
AdventureWorks databases in SQL Server Management Studio.
Installing and Attaching the AdventureWorks Sample Database
For your database query purposes and in order to build a database application with C#, you need a
database. For these purposes, this topic will use AdventureWorks for the SQL Server 2012 release.
Installing the AdventureWorks Database
To install the database, follow these steps:
1. Go to http://msftdbprodsamples.codeplex.com/releases/view/4004 , an d click
the link AdventureWorksDB.msi.
2. Click I Agree for the license agreement; you will be prompted to run or save the
AdventureWorksDB.msi file to your system.
3. Change the location to save the file; you can keep it anywhere on your
computer system, but it is recommended you keep it with the other database
files under your SQL Server instance, which will be located at C:\Program
Files\Microsoft SQL Server\MSSQL11.<your SQL Server 2012 instance
name>\MSSQL\DATA . You can verify the folder name of your SQL instance by
 
Search WWH ::




Custom Search