Now that we have successfully installed Microsoft SQL Server
2012, I'd like to load up some sample data.
The sample data I'd like to use is the AdventureWorks
Database, specifically the Data Warehousing
version of the AdventureWorks Database.
So if you want to point your browser over to your favorite search engine and
look for AdventureWorks, you can specify the
2012 version and specify Data Warehouse version.
This will give me a few choices.
The first option looks promising.
I'll click on that.
It's taken me to several pieces of sample data for Microsoft SQL Server 2012.
The one I am interested in is second from the top.
The AdventureWorks DW 2012 data file.
The DW stands for Data Warehouse.
I'll click on that and, in the pop-up asking if it's OK
to download, I'll say save, and then I can view that download.
What it's given me is an MDF file, a SQL Server database data file.
I'll need to attach that inside of the SQL Server instance.
It's possible that I could just leave the file where
it is and just set the appropriate permissions on it.
But it will probably be easier to copy the file to
a directory that I know already has the permissions set appropriately.
So I'm going to copy this.
And go to the default directory for SQL
Server Data, which is Program Files, SQL Server.
This is MS SQL Server version 11.
I want
the Data folder.
And I'll paste it into there.
That should automatically apply the appropriate permissions.
Now I'll open SQL Server Management Studio.
I'll connect to the local database server.
In Databases, I'll right click and select Attach.
I'll need to tell it where the MDF file is, and it
went to my default data folder where I'd just copied that file.
At the bottom, it is assumed that I have both a data and a log.
That's actually an inaccurate assumption.
I don't yet have a log.
I'll just click Remove here and then, when I
attach the database, it will automatically create the log.
I'll click OK, and if we expand the
tree option for databases, we now see AdventureWorksDW2012.
That's good.
I'll expand that, expand Tables.
And I'm just going to go to a random table and select the top records.
Just to make sure everything's there.
We got some results back.
That implies that the database has successfully attached.
And we are able to use it.
We'll call this success.