Reputation: 59
Am trying to learn MDX using book called "Microsoft SQL Server 2008 MDX Step by step", and i downloaded the samples databases for the book , but when trying to attach the database it gives me an error "Access denied" , I'm trying to attach the database to SQL Server 2008 R2, will it make a difference to attach it to R2 as the book tutorial and samples is for 2008 only ??, Note that i searched for the error and it said that i had to delete also the log file that is downloaded with the samples database, i did that also but nothing worked
Please help
Upvotes: 1
Views: 1200
Reputation: 1924
I had the same error several times. It has nothing to do with your version, i have done it on both SQL Server 2008 and SQL Server 2012. It´s because of some denied access to the folders where you downloaded and installed the MDX-stuff. One way to solve it is to copy the "MdxStepByStep.mdf" & "MdxStepBySteplog" files to your data-folder where the other databases lies. My path is for example:
"C:\Program Files\Microsoft SQL Server\MSSQL11\MSSQL\DATA".
Then you just change the script´s path to:
exec master..sp_attach_db
'MdxStepByStep',
'C:\Program Files\Microsoft SQL Server\MSSQL11\MSSQL\DATA\MdxStepByStep.mdf'
Do not copy the "MdxStepByStep_log" because then you will get an error that the file already exists. It should work, also there should not be any problem with the analysis cube if i remember correctly, tell me if there is and i will look into it.
Upvotes: 2