Wednesday, March 28, 2012
How to change sql login username instead of create new one.
(in master) or the user name (in your database)? Anyhow, you cannot change the name of a login or a
user, You will be able to rename a user in 2005, not sure about login, though.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pleo" <rx8@.hotmail.com> wrote in message news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...
> As title, thanks!
>|||I'm not familiar sql. At enterprise server (sql2000) > security > logins >
(want to change name here).
Anyway, I guess it can't be changed there. Thanks.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> ?
news:%23R4Ixpv0FHA.3068@.TK2MSFTNGP10.phx.gbl ?...
> Can you explain what you mean by "change sql login username"? Are you
referring to the login name
> (in master) or the user name (in your database)? Anyhow, you cannot change
the name of a login or a
> user, You will be able to rename a user in 2005, not sure about login,
though.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pleo" <rx8@.hotmail.com> wrote in message
news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...
> > As title, thanks!
> >
> >
>|||Hi,
As Tibor mentioned; In SQL 2000 you can not rename a SQL Server Login or
database user.
Thanks
Hari
SQL Server MVP
"Pleo" <rx8@.hotmail.com> wrote in message
news:ON0lytv0FHA.404@.TK2MSFTNGP09.phx.gbl...
> I'm not familiar sql. At enterprise server (sql2000) > security > logins >
> (want to change name here).
> Anyway, I guess it can't be changed there. Thanks.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> ?
> news:%23R4Ixpv0FHA.3068@.TK2MSFTNGP10.phx.gbl ?...
>> Can you explain what you mean by "change sql login username"? Are you
> referring to the login name
>> (in master) or the user name (in your database)? Anyhow, you cannot
>> change
> the name of a login or a
>> user, You will be able to rename a user in 2005, not sure about login,
> though.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Pleo" <rx8@.hotmail.com> wrote in message
> news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...
>> > As title, thanks!
>> >
>> >
>|||Hi,
Yes, you can rename a SQL Server Login. You have to manually change values
in master.dbo.syslogins and master.dbo.sysxlogins.
Gabi Tianu
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:uW5cTJ80FHA.916@.TK2MSFTNGP10.phx.gbl...
> Hi,
> As Tibor mentioned; In SQL 2000 you can not rename a SQL Server Login or
> database user.
> Thanks
> Hari
> SQL Server MVP
> "Pleo" <rx8@.hotmail.com> wrote in message
> news:ON0lytv0FHA.404@.TK2MSFTNGP09.phx.gbl...
>> I'm not familiar sql. At enterprise server (sql2000) > security > logins
>> >
>> (want to change name here).
>> Anyway, I guess it can't be changed there. Thanks.
>>
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> ?
>> news:%23R4Ixpv0FHA.3068@.TK2MSFTNGP10.phx.gbl ?...
>> Can you explain what you mean by "change sql login username"? Are you
>> referring to the login name
>> (in master) or the user name (in your database)? Anyhow, you cannot
>> change
>> the name of a login or a
>> user, You will be able to rename a user in 2005, not sure about login,
>> though.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Pleo" <rx8@.hotmail.com> wrote in message
>> news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...
>> > As title, thanks!
>> >
>> >
>>
>|||sysxlogins is the name of the table, and syslogins is a view. So, the only place where a change
would be needed is sysxlogins. However, hacking system tables is not supported and Pleo would be on
his own by doing that.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Gabi Tianu" <gabi_tianu@.hotmail.com> wrote in message news:eS3wd$T1FHA.1108@.TK2MSFTNGP14.phx.gbl...
> Hi,
> Yes, you can rename a SQL Server Login. You have to manually change values in master.dbo.syslogins
> and master.dbo.sysxlogins.
> Gabi Tianu
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:uW5cTJ80FHA.916@.TK2MSFTNGP10.phx.gbl...
>> Hi,
>> As Tibor mentioned; In SQL 2000 you can not rename a SQL Server Login or database user.
>> Thanks
>> Hari
>> SQL Server MVP
>> "Pleo" <rx8@.hotmail.com> wrote in message news:ON0lytv0FHA.404@.TK2MSFTNGP09.phx.gbl...
>> I'm not familiar sql. At enterprise server (sql2000) > security > logins >
>> (want to change name here).
>> Anyway, I guess it can't be changed there. Thanks.
>>
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> ?
>> news:%23R4Ixpv0FHA.3068@.TK2MSFTNGP10.phx.gbl ?...
>> Can you explain what you mean by "change sql login username"? Are you
>> referring to the login name
>> (in master) or the user name (in your database)? Anyhow, you cannot change
>> the name of a login or a
>> user, You will be able to rename a user in 2005, not sure about login,
>> though.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Pleo" <rx8@.hotmail.com> wrote in message
>> news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...
>> > As title, thanks!
>> >
>> >
>>
>>
>|||Very good point Tibor. Any unsupported change to the system table allways
has to be done first in a test environment.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OIynWFU1FHA.916@.TK2MSFTNGP10.phx.gbl...
> sysxlogins is the name of the table, and syslogins is a view. So, the only
> place where a change would be needed is sysxlogins. However, hacking
> system tables is not supported and Pleo would be on his own by doing that.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Gabi Tianu" <gabi_tianu@.hotmail.com> wrote in message
> news:eS3wd$T1FHA.1108@.TK2MSFTNGP14.phx.gbl...
>> Hi,
>> Yes, you can rename a SQL Server Login. You have to manually change
>> values in master.dbo.syslogins and master.dbo.sysxlogins.
>> Gabi Tianu
>> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
>> news:uW5cTJ80FHA.916@.TK2MSFTNGP10.phx.gbl...
>> Hi,
>> As Tibor mentioned; In SQL 2000 you can not rename a SQL Server Login or
>> database user.
>> Thanks
>> Hari
>> SQL Server MVP
>> "Pleo" <rx8@.hotmail.com> wrote in message
>> news:ON0lytv0FHA.404@.TK2MSFTNGP09.phx.gbl...
>> I'm not familiar sql. At enterprise server (sql2000) > security >
>> logins >
>> (want to change name here).
>> Anyway, I guess it can't be changed there. Thanks.
>>
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> ?
>> news:%23R4Ixpv0FHA.3068@.TK2MSFTNGP10.phx.gbl ?...
>> Can you explain what you mean by "change sql login username"? Are you
>> referring to the login name
>> (in master) or the user name (in your database)? Anyhow, you cannot
>> change
>> the name of a login or a
>> user, You will be able to rename a user in 2005, not sure about login,
>> though.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Pleo" <rx8@.hotmail.com> wrote in message
>> news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...
>> > As title, thanks!
>> >
>> >
>>
>>
>>
>|||Hi Gabi,
This is not recommended by microsoft to update or modify system tables.
from
Dollerssql
How to change sql login username instead of create new one.
ing to the login name
(in master) or the user name (in your database)? Anyhow, you cannot change t
he name of a login or a
user, You will be able to rename a user in 2005, not sure about login, thoug
h.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pleo" <rx8@.hotmail.com> wrote in message news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...[vbco
l=seagreen]
> As title, thanks!
>[/vbcol]|||I'm not familiar sql. At enterprise server (sql2000) > security > logins >
(want to change name here).
Anyway, I guess it can't be changed there. Thanks.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> ?
news:%23R4Ixpv0FHA.3068@.TK2MSFTNGP10.phx.gbl ?...
> Can you explain what you mean by "change sql login username"? Are you
referring to the login name
> (in master) or the user name (in your database)? Anyhow, you cannot change
the name of a login or a
> user, You will be able to rename a user in 2005, not sure about login,
though.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pleo" <rx8@.hotmail.com> wrote in message
news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...
>|||Hi,
As Tibor mentioned; In SQL 2000 you can not rename a SQL Server Login or
database user.
Thanks
Hari
SQL Server MVP
"Pleo" <rx8@.hotmail.com> wrote in message
news:ON0lytv0FHA.404@.TK2MSFTNGP09.phx.gbl...
> I'm not familiar sql. At enterprise server (sql2000) > security > logins >
> (want to change name here).
> Anyway, I guess it can't be changed there. Thanks.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> ?
> news:%23R4Ixpv0FHA.3068@.TK2MSFTNGP10.phx.gbl ?...
> referring to the login name
> the name of a login or a
> though.
> news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...
>|||Hi,
Yes, you can rename a SQL Server Login. You have to manually change values
in master.dbo.syslogins and master.dbo.sysxlogins.
Gabi Tianu
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:uW5cTJ80FHA.916@.TK2MSFTNGP10.phx.gbl...
> Hi,
> As Tibor mentioned; In SQL 2000 you can not rename a SQL Server Login or
> database user.
> Thanks
> Hari
> SQL Server MVP
> "Pleo" <rx8@.hotmail.com> wrote in message
> news:ON0lytv0FHA.404@.TK2MSFTNGP09.phx.gbl...
>|||sysxlogins is the name of the table, and syslogins is a view. So, the only p
lace where a change
would be needed is sysxlogins. However, hacking system tables is not support
ed and Pleo would be on
his own by doing that.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Gabi Tianu" <gabi_tianu@.hotmail.com> wrote in message news:eS3wd$T1FHA.1108@.TK2MSFTNGP14.ph
x.gbl...
> Hi,
> Yes, you can rename a SQL Server Login. You have to manually change values
in master.dbo.syslogins
> and master.dbo.sysxlogins.
> Gabi Tianu
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:uW5cTJ80FHA.916@.TK2MSFTNGP10.phx.gbl...
>|||Very good point Tibor. Any unsupported change to the system table allways
has to be done first in a test environment.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OIynWFU1FHA.916@.TK2MSFTNGP10.phx.gbl...
> sysxlogins is the name of the table, and syslogins is a view. So, the only
> place where a change would be needed is sysxlogins. However, hacking
> system tables is not supported and Pleo would be on his own by doing that.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Gabi Tianu" <gabi_tianu@.hotmail.com> wrote in message
> news:eS3wd$T1FHA.1108@.TK2MSFTNGP14.phx.gbl...
>|||Hi Gabi,
This is not recommended by microsoft to update or modify system tables.
from
Dollers
How to change sql login username instead of create new one.
Can you explain what you mean by "change sql login username"? Are you referring to the login name
(in master) or the user name (in your database)? Anyhow, you cannot change the name of a login or a
user, You will be able to rename a user in 2005, not sure about login, though.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pleo" <rx8@.hotmail.com> wrote in message news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...
> As title, thanks!
>
|||I'm not familiar sql. At enterprise server (sql2000) > security > logins >
(want to change name here).
Anyway, I guess it can't be changed there. Thanks.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> ?
news:%23R4Ixpv0FHA.3068@.TK2MSFTNGP10.phx.gbl ?...
> Can you explain what you mean by "change sql login username"? Are you
referring to the login name
> (in master) or the user name (in your database)? Anyhow, you cannot change
the name of a login or a
> user, You will be able to rename a user in 2005, not sure about login,
though.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pleo" <rx8@.hotmail.com> wrote in message
news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...
>
|||Hi,
As Tibor mentioned; In SQL 2000 you can not rename a SQL Server Login or
database user.
Thanks
Hari
SQL Server MVP
"Pleo" <rx8@.hotmail.com> wrote in message
news:ON0lytv0FHA.404@.TK2MSFTNGP09.phx.gbl...
> I'm not familiar sql. At enterprise server (sql2000) > security > logins >
> (want to change name here).
> Anyway, I guess it can't be changed there. Thanks.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> ?
> news:%23R4Ixpv0FHA.3068@.TK2MSFTNGP10.phx.gbl ?...
> referring to the login name
> the name of a login or a
> though.
> news:eVAlmnv0FHA.2428@.tk2msftngp13.phx.gbl...
>
|||Hi,
Yes, you can rename a SQL Server Login. You have to manually change values
in master.dbo.syslogins and master.dbo.sysxlogins.
Gabi Tianu
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:uW5cTJ80FHA.916@.TK2MSFTNGP10.phx.gbl...
> Hi,
> As Tibor mentioned; In SQL 2000 you can not rename a SQL Server Login or
> database user.
> Thanks
> Hari
> SQL Server MVP
> "Pleo" <rx8@.hotmail.com> wrote in message
> news:ON0lytv0FHA.404@.TK2MSFTNGP09.phx.gbl...
>
|||sysxlogins is the name of the table, and syslogins is a view. So, the only place where a change
would be needed is sysxlogins. However, hacking system tables is not supported and Pleo would be on
his own by doing that.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Gabi Tianu" <gabi_tianu@.hotmail.com> wrote in message news:eS3wd$T1FHA.1108@.TK2MSFTNGP14.phx.gbl...
> Hi,
> Yes, you can rename a SQL Server Login. You have to manually change values in master.dbo.syslogins
> and master.dbo.sysxlogins.
> Gabi Tianu
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:uW5cTJ80FHA.916@.TK2MSFTNGP10.phx.gbl...
>
|||Very good point Tibor. Any unsupported change to the system table allways
has to be done first in a test environment.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OIynWFU1FHA.916@.TK2MSFTNGP10.phx.gbl...
> sysxlogins is the name of the table, and syslogins is a view. So, the only
> place where a change would be needed is sysxlogins. However, hacking
> system tables is not supported and Pleo would be on his own by doing that.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Gabi Tianu" <gabi_tianu@.hotmail.com> wrote in message
> news:eS3wd$T1FHA.1108@.TK2MSFTNGP14.phx.gbl...
>
|||Hi Gabi,
This is not recommended by microsoft to update or modify system tables.
from
Dollers
Monday, March 26, 2012
How to change owner of database? Please help!
Hi,
I just transferred my website and database (SQL 2000) to a new host who's SQL Manager doesn't support the previous username I had for the database.
The previous owner of database tables etc was Database_master and now I want to change it to just Master.
Please advise! Someone else designed the website for me, and honestly I have just some basic knowledge of databases and such.
I would appreciate help and if possible with detailed steps.
Many thanks in advance,
Isje
From BOL at http://msdn2.microsoft.com/en-us/library/ms178630.aspx, use:
sp_changedbowner (Transact-SQL)
Changes the owner of the current database.
sp_changedbowner [ @.loginame = ] 'login'
[ , [ @.map= ] remap_alias_flag ]
Thanks very much for your reply. I found a solution in the meantime. It took me some time though :(
Here is what I did:
1. Run this script in Query Analyser (here the owner becomes newowner) :
SELECT 'EXEC(''sp_changeobjectowner @.objname = '''''+
ltrim(u.name) + '.' + ltrim(s.name) + ''''''
+ ', @.newowner = newowner'')'
FROM sysobjects s,
sysusers u
WHERE s.uid = u.uid
AND u.name <> 'dbo'
AND xtype in ('V', 'P', 'U')
AND u.name not like 'INFORMATION%'
order by s.name
2. Then Copy-paste the result in Query analayser, and run!