Sunday, March 25, 2012

Can't Attach Database using SQL Server Management Studio Express

I am having a problem Attaching, well actually not being able to see a database when attempting to attach it. I suspect this is more of a security issue rather than a problem with Management Studio, but I can't figure out what is happening.

If I copy a database to Documents and Settings\All Users\... and attempt to attach I can see the file in the selection tree. This also is the case if I copy it to Documents and Settings\Default User\... But if I copy it to Documents and Settings\ADynarski\... which is the account I normally log into, when I expand the folder in the selection tree, nothing is visible. And the same thing occurs if I copy the file to Documents and Settings\Guest\...

I've looked at the security settings and everything appears to be normal. This is on a box with XP Home and SQL Server Express. Can anyone tell me what I'm missing?

Thanks,

Al

What is the account your SQL Server service running under?

If it's domain account, make sure the account has access to the folder you are trying attach database from.

|||Thanks for your input. It is a domain account and the account does have access to the folder. What is really strange is that I used Visual Web Developer Express to create the database in C:\Documents and Settings\Al Dynarski\My Documents\... and it functions properly. But logged into the same account, Server Management Studio sees nothing in the folder C:\Documents and Settings\Al Dynarski or below. I can copy the database out to another folder and then use Server Manangement Studio to work on it. Very strange. I'll continue to look around. Thanks again.|||

Why are you copying the database files to a user folder rather than a common system folder ? If you want to attach the database files not via the userinstance feature, the SQL Server Service need to have access to the specified file for the database, so make sure that the service the SQL Server Account is running on, has access to this file destination.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Thanks for your suggestion. I don't want to have to copy it; I only tried that to be sure it was in fact a valid database. And I agree with your assessment about SQL service having access rights to the folder containing the database. My problem appears to be figuring out why it doesn't Thanks again.|||

I got it working. I switched SQL Server Express to Local System Login and I now can see the database files and attach them. Since this server instance is just for my local testing, this configuration should work for me. Thanks to all for your suggestions.

Al

|||

Hi Al,

I am having the same problem.... how do you switch SQL Server Express to Local System Login, and in doing so what else does this affect?

Thanks,

Claude.

|||

Go to the SCM (Service Control Manager) of Windows, sleect the service you want to change the logon settings for, right click properties, go to the LogOn Tab and change the account to "Local System". Keep in min d that the service needs a restart after changing the settings.

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||

Hi Claude,

The solution Jens indicated is exactly what I did.

Good Luck!

Al

No comments:

Post a Comment