PDA

View Full Version : AdventureWorksDW2012



Bob Phillips
02-22-2014, 06:21 AM
I am trying to add the above db sample file to SQL Server 2012. When I try to attach it, I get the error shown at the end.

I am adding it in SSMS. When I select the file, it adds the .mdf and .ldf, and I removed the .ldf. The file is not read-only.

I have also downloaded the AdventureWorks2012 OLTP database, and that attaches fine, I cannot see any difference.

I am sure it is a permissions problem somewhere, but I cannot see where. Anyone have any ideas?


TITLE: Microsoft SQL Server Management Studio
------------------------------

Attach database failed for Server 'VISIZEN'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperatio nExceptionText&EvtID=Attach+database+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

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

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

Could not open new database 'AdventureWorksDW2012'. CREATE DATABASE is aborted.
File activation failure. The physical file name "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\AdventureWorksDW2012_log.ldf" may be incorrect.
The log cannot be rebuilt when the primary file is read-only. (Microsoft SQL Server, Error: 1813)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.3128&EvtSrc=MSSQLServer&EvtID=1813&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------

Paul_Hossler
03-01-2014, 07:49 PM
(Very) Long shot, and about all I can do is spell SQL :rofl: but maybe if you tried to create it in a folder other than 'Program Files' ???

I've had permissions issues sometimes with system 'protected' folders like that

Paul

Bob Phillips
03-02-2014, 06:19 AM
I tried that originally Paul, and my first thought was that was the reason, it had to be in MS' specially constructed MSSQL (it doesn't actually, but being elsewhere requires a lot of other settings/permissions).

And I am administrator, so if I start with insufficient permissions, Windows 7 lets me add them when required.

As mentioned, I have also downloaded the OLTP database, I can't see anything different in the the two files or how I tried to attach them, but teh OLTP database attached perfectly, first time.