Search code examples
sql-serverdatabasesqlcmdadventureworks

AdventureWorks activation error in SQL Server, I don't know if it is my pathway is wrong or my database is wrong


I'm trying to add AdventureWorks to my SQL Server 2014 Management Studio. After I opened the query in SQLCMD code, I changed the setvar path to my server name.

How do I fix this error?

I have the following error message:

Started - 2016-07-09 00:32:33.533

*** Dropping Database

*** Creating Database

Msg 5133, Level 16, State 1, Line 89
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL12.DACHENMCIS\MSSQL\DATA\AdventureWorksDW2014_Data.mdf" failed with the operating system error 3(The system cannot find the path specified.).

Msg 1802, Level 16, State 1, Line 89
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

*** Checking for AdventureWorksDW2014 Database
*** AdventureWorksDW2014 Database does not exist. Make sure that the script is being run in SQLCMD mode and that the variables have been correctly set.

Msg 911, Level 16, State 1, Line 119
Database 'AdventureWorksDW2014' does not exist. Make sure that the name is entered correctly.

Msg 208, Level 16, State 1, Procedure vDMPrep, Line 1683
Invalid object name 'dbo.FactInternetSales'.

Msg 208, Level 16, State 1, Procedure vTimeSeries, Line 1731
Invalid object name 'dbo.vDMPrep'.

Msg 208, Level 16, State 1, Procedure vTargetMail, Line 1796
Invalid object name 'dbo.DimCustomer'.

Msg 208, Level 16, State 1, Procedure vAssocSeqOrders, Line 1828
Invalid object name 'dbo.vDMPrep'.


Solution

  • Add privileges to "C:\Program Files\Microsoft SQL Server\MSSQL12.DACHENMCIS\MSSQL\DATA\", you don't have all required.

    Or if possibly the path is not valid, Replace "C:\Program Files\Microsoft SQL Server\MSSQL12.DACHENMCIS\MSSQL\DATA\" with an existing folder path on which you have full privileges and you'll be fine.