The Wrecking Bawl

Destructuring query language, one keyword at a time.


News


For anybody that bought the SQL Server 2008 Self-Paced Training book for 70-433, if you are running a full version of SQL Server 2008 rather than the express edition, you will have problems attaching the AdventureWorks2008 database (file activation error).  The trick is to use a SQL command, like so:

 
USE [master]
GO
CREATE DATABASE [AdventureWorks2008] ON
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\AdventureWorks2008_Data.mdf' ),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\AdventureWorks2008_Log.ldf' ),
 FILEGROUP Documents CONTAINS FILESTREAM (NAME = Documents, FILENAME=N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\Documents')
 FOR ATTACH
GO

Comments

Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by Mt on 8/18/2009 12:21 AM
not working, "Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\AdventureWorks2008_Data.mdf" failed with the operating system error 3(failed to retrieve text for this error. Reason: 1815)."
What's the problem?
Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by Rov on 11/4/2009 4:42 AM
I racked my brain for 2 days. Searched numerous blogs on the net for a solution to attach AdventureWorks2008 database but to no vail. Your script did the trick. Thanks heaps for sharing.
Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by Nelson on 11/23/2009 3:26 AM
I keep having the same problem as MT and:
Msg 5134, Level 16, State 2, Line 1
The path that is specified by 'c:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\mssql\DATA\Documents' cannot be used for FILESTREAM files because it is not on a supported file system.

So yes. Fun times. Any ideas anyone? I'm running XP Pro on a fat32 if that has anything to do with it.
Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by Nelson on 11/26/2009 7:03 AM
Okay so I figured it out. My problem was that I was running windows on a Fat32 partition. I reformatted the partition as NTFS and followed all the default instructions for installing the AdventureWorks data pack 3 from codeplex. AdventureWorks2008 installed without a hitch. I'll just deal with not being able to write to that partition while booted into OSX.
Gravatar # Ms
Posted by Lisa Morgan on 2/4/2010 10:16 AM
This is wonderful. I looked everywhere for a workaround, and this solved the problem. All I had to do was replace MSSQL10.SQL2008 with MSSQL10.MYINSTANCENAME
in the file names and it attached great. Back to studying for my exam!

Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by Rams on 2/15/2010 3:40 AM
Thank you very much..i am trying this for 1 week..your script did it
Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by Dickon on 7/3/2010 5:27 AM
Thanks for this - I struggled to attach this db for 2 days before I found your post. I'd love to know why this db will not attach using the GUI driven command.
Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by Rick Mays on 12/16/2010 10:02 AM
Hi. Just wanted to say thank you for this post. I had searched for days trying to find a solution. This worked perfectly.

Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by paddy on 12/23/2010 8:18 AM
Thanks a ton for the script. i was breaking my head over the issue in running advanceworks2008 db. finally it worked fine after running the above scripts.. thanks a lot again..
Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by Rolo on 6/18/2011 10:03 PM
Just wanted to thank you! this was very helpful, i had to activate the FILESTREAM from the configuration manager, but that was it! thanx again for your sharing! ;)
Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by Lee on 6/21/2011 7:40 AM
"...you the man!"
Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by amir on 8/1/2011 3:29 AM
first it didn't work for me.
but i made this change:
right click on the server name->properties->Advanced->Filestream Access level->FULL ACCESS ENABLED
Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by iman on 8/25/2011 3:15 AM
like amir , for me the problem was only enabling 1-filestream through configuration manager
and then
2-EXEC sp_configure filestream_access_level, 2
RECONFIGURE

alternative for
Filestream Access level->FULL ACCESS ENABLED
from object explorer in SSMS
3- and then the normal attach command from SSMS worked

How to: Enable FILESTREAM
http://msdn.microsoft.com/en-us/library/cc645923%28v=sql.100%29.aspx
Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by njaps on 9/5/2011 4:07 AM
u saved the day man
Gravatar # re: attaching adventureworks2008 on full version of sql server
Posted by Anil on 12/4/2011 9:57 PM
Great. It worked for me. I was searching the net for along. Thanks a lot
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: