question

MuhSQL avatar image
MuhSQL asked

Change Servername,Database owner

Hi... I changed the name of my computer,then I used these queries to change it also in SQLServer2008 sp_dropserver 'old_name_server' sp_addserver 'new_name_server',local Then I restart the service when I use select @@servername it give the correct name. But when I create new database I noticed that the owner for this new database still consists of [old_name_server/Login_name] How can I solve this problem ?
sql-server-2008
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Oleg avatar image
Oleg answered
It looks like you have to issue the **alter login** for each of the logins that you have. This is because changing the server name did not do anything to logins. Of course it goes without saying that after that you might want to consider changing the names of the database users mapped to the logins. The syntax to change the login alter login OriginalName with name = NewName; Oleg
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.