Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Attached DB with different password for SA

Author  Topic 

rternier
Starting Member

44 Posts

Posted - 2010-03-29 : 12:19:59
My local SQL 2008 server setup has a password for SA (let's say): 1234

I attached a new DataBase from a production server for testing. This server uses a different SA password.

Through C# Code, i can connect to my Database server (local) with the SA login. I can get a list of databases.

however, whenever I try to open a connection to this specific DataBase, it bombs telling me:

"Cannot open database \"db_attached_DB\" requested by the login. The login failed.\r\nLogin failed for user 'sa'."

Is this because the sa password was different on the other server... or is something else at play here?

----
Killer ASP.NET ninja coding monkeys do exist!
[url]http://weblogs.asp.net/rternier[/url]

rternier
Starting Member

44 Posts

Posted - 2010-03-29 : 12:41:09
I should also say I can connect to this database in Management Studio if I login to my system through username/password using SA. (i can do the same when i login using default credentials).

But I cannot access this database through code using SA.

----
Killer ASP.NET ninja coding monkeys do exist!
[url]http://weblogs.asp.net/rternier[/url]
Go to Top of Page
   

- Advertisement -