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 2000 Forums
 SQL Server Development (2000)
 default user

Author  Topic 

Ex
Posting Yak Master

166 Posts

Posted - 2005-01-10 : 22:55:47
Hey all i know this is such a newbit question but having some problems in googling the solution

i want change the default USER in the database (in query analyser)

at the moment i get dbo i want say 'IAMAUSER' or something like this

help would be appricated laughter would be understandable :) hehe

thanks

clarkbaker1964
Constraint Violating Yak Guru

428 Posts

Posted - 2005-01-10 : 22:58:21
I think this is picked up based on the last login.

Go to Top of Page

Ex
Posting Yak Master

166 Posts

Posted - 2005-01-10 : 23:48:09
i figured out
sp_grantdbaccess does kinda what i want

i can create a new user like so

sp_addlogin @loginame = 'newuser', @passwd = 'newpass'
sp_grantdbaccess 'newuser'
sp_addrolemember 'db_owner', 'newuser'

and i can name it like so


sp_addlogin @loginame = 'newuser', @passwd = 'newpass'
sp_grantdbaccess 'newuser', 'MEEEEEEEEE'
sp_addrolemember 'db_owner', 'newuser'

so if i did a SELEC USER now the result would be 'MEEEEEEEEE'


but how can i do that for the default sa account change the value given so its not dbo? anyone know a sp?
Go to Top of Page

Ex
Posting Yak Master

166 Posts

Posted - 2005-01-11 : 00:22:15
for a bit more info
if i run the sp
sp_helplogins

the value i want to change is the USERNAME for the LoginName sa

:) if possible
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-01-11 : 01:54:41
from experience, sa account "name" is not editable, but you can try to map it to another user, though haven't tried this (nor do i have any use for doing so, coz you can assign sa privileges anyway)

try sp_change_users_login

also, you might hit something in SQL which will change laughter to tears if you change this account aside from password



--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -