Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Basically whenever I create a new database the user maps to dbo rather than the actual login property as illustrated below fsdgsgsg is a new one but staff and warehouse are attached databases from elsewhere.
http://imageshack.us/photo/my-images/854/error1q.png


When I try to change it to MASTER\Milton it comes up with this error. Its screwing my ADO.Net up and stopping me from accessing it. Anyone know how to fix this?

http://imageshack.us/photo/my-images/267/error2e.png
Posted

1 solution

dbo isn't actually a user as in traditional sense. dbo means the database owner. This 'user' cannot be renamed since it's a pseudo user.

If you want you can create objects inside the database with other credentials and they will become the owners of the objects (tables, view, procedures and so on).

What is the actual problem/code what isn't working when calling the database?
 
Share this answer
 
Comments
WurmInfinity 10-Jan-12 17:17pm    
I've managed to switch the user back by unattaching all databases and reattaching god knows why that fixed it ... but it says 'Failed to log in with MASTER\Milton' anyway so now i fix it the bloody stored procedure just wont work... one thing after another xD
Wendelius 10-Jan-12 17:27pm    
Ok, that's a whole different story. If you have attached the database from another instance one probable cause for the call to fail is that you don't have login for MASTER\Milton at all in this SQL Server instance. Open the SSMS and check/add necessary logins (depending on the situation you may have to re-create the database user also).
WurmInfinity 10-Jan-12 17:28pm    
I think it may be down to the code being (local) and me being a total tool and going through the server 'SQLExpress' im gunna try this out hopefully it works >.<
WurmInfinity 10-Jan-12 18:02pm    
Fixed it, i was right im an idiot. Thanks for your time
Wendelius 10-Jan-12 18:03pm    
You're welcome :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900