Scripts to create AdventureWorks

  • Hi all,

    Can anyone point me in the right direction to find the create/insert scripts for AdventureWorks (2005 or 2008 will suffice).

    All I've been able to find are the .msi installers which I've had a bit of trouble with, so would rather run the scripts but after an hour or two searching MS and Codeplex I still couldn't find them.

    Many thanks,

    Jason

    ---

  • I've not actually seen the scripts anywhere, also only the .MSIs. What kinds of issues are you seeing with the MSIs? Perhaps we can help?

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • Hi Luke,

    initially the msi's wouldn't even install. (possibly complicated by the fact that I'm running SSMS in a Windows XP guest os on a Mac using Parallels software).

    But when I did manage to get the .mdf installed when I tried to attach the database I received an error message that I can't actually remember properly. I'll try again tonight when I get home & post the error msg (I did return the error code to MS as you an but it said no help was available for the particualr error msg).

    Regards...Jason

  • here you go jason:

    i don't think the msi works unless you have SP2a or above installed;

    i ran the msi, which drops an mdf/ldf pair in the default data folder so it can be attachted.

    I attached it and backed it up for you;

    download this zip and restore the backup inside:

    33mb zip of 167 mb Adventureworks.bak

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Wow....thanks Lowell.

    I'm just downloading it now (but am doing so via 3G so will take a while).

    Out of interest, the error message when trying to attach originally is pasted below the ------

    I'd be interested exactly what the problem was if you can help.

    Thanks again for backing up & zipping the files. I really appreciate it. I never fail to be surprised by the level of help people are prepared to offer on SSC.

    All the best

    Jason

    ------------------------------

    Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

    ------------------------------

    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf'. (Microsoft SQL Server, Error: 5123)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.1600&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476

  • Hi,

    Thanks again for backing up the database. When I restore it, I can restore from device, select the file, and see the contents. But after selecting 'restore' I get the following error msg (which contains the same '5Access Denied' text as my earlier problem).

    Any ideas?.....Many thanks, Jason

    ------------------------------

    Restore failed for Server 'MACBOOKPRO\SQLEXPRESS'. (Microsoft.SqlServer.SmoExtended)

    ------------------------------

    ADDITIONAL INFORMATION:

    System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks.mdf'. (Microsoft.SqlServer.Smo)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&LinkId=20476

  • definitely permissions related...operating system privileges, not related to SQL.

    i think if you right click on the shortcut to SQL Server Management Studio, you can choose Run As...

    if you do that and choose administrator, you'd have the necessary permissions.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Great..thanks.

    I'm not a DBA, but a business analyst, so just use SSMS for querying and reporting/olap work, so have never needed to worry about permissions. It's only since installing SSMS myself on my own machine at home that I've had to mess around 'behind the scenes' 🙂

    Thanks again for the help.

    All the best,

    Jason

    ---

  • Doh! When I run SSMS as an administrator, I then receive the following:

    CREATE DATABASE permission denied in database 'master'.

    RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 262)

    I told you I wasn't a DBA ! (and now my other sample DBs - northwind, pubs etc. aren't visible), error msg is:-

    The server principal "MACBOOKPRO\Administrator" is not able to access the database "Northwind" under the current security context. (Microsoft SQL Server, Error: 916)

    Sorry to be a pain!

    rgds...Jason

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply