Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Thursday, March 8, 2012

DDL Triggers

I know that DDL_LOGIN_EVENTS is the same as CREATE LOGIN, ALTER LOGIN and DROP LOGIN combined but where is this documented?

I have some code here (http://sqlservercode.blogspot.com/2006/08/ddl-trigger-events-revisited.html) that basically shows that you can combine events

But where is this info in BOL?

For example if I do this:

create a trigger and I use DDL_VIEW_EVENTS

CREATE TRIGGER ddlTestEvents
ON DATABASE
FOR DDL_VIEW_EVENTS
AS
PRINT 'You must disable Trigger "ddlTestEvents" to drop, create or alter Views!'
ROLLBACK;
GO

After that I would check the sys.triggers and sys.trigger_events views to see what was inserted

SELECT name,te.type,te.type_desc
FROM sys.triggers t
JOIN sys.trigger_events te on t.object_id = te.object_id
WHERE t.parent_class=0
AND name IN('ddlTestEvents')
ORDER BY te.type,te.type_desc

In this case 3 rows were inserted

DDL_VIEW_EVENTS
-
41 CREATE_VIEW
42 ALTER_VIEW
43 DROP_VIEW

So here is the complete list for who wants it

DDL_VIEW_EVENTS
-
41 CREATE_VIEW
42 ALTER_VIEW
43 DROP_VIEW

DDL_USER_EVENTS
-
131 CREATE_USER
132 ALTER_USER
133 DROP_USER

DDL_XML_SCHEMA_COLLECTION_EVENTS
-
177 CREATE_XML_SCHEMA_COLLECTION
178 ALTER_XML_SCHEMA_COLLECTION
179 DROP_XML_SCHEMA_COLLECTION

DDL_VIEW_EVENTS
-
41 CREATE_VIEW
42 ALTER_VIEW
43 DROP_VIEW

DDL_TRIGGER_EVENTS
-
71 CREATE_TRIGGER
72 ALTER_TRIGGER
73 DROP_TRIGGER

DDL_USER_EVENTS
-
131 CREATE_USER
132 ALTER_USER
133 DROP_USER

DDL_TYPE_EVENTS
-
91 CREATE_TYPE
93 DROP_TYPE

DDL_TABLE_EVENTS
-
21 CREATE_TABLE
22 ALTER_TABLE
23 DROP_TABLE

DDL_SYNONYM_EVENTS
-
34 CREATE_SYNONYM
36 DROP_SYNONYM

DDL_STATISTICS_EVENTS
--
27 CREATE_STATISTICS
28 UPDATE_STATISTICS
29 DROP_STATISTICS

DDL_SERVICE_EVENTS

161 CREATE_SERVICE
162 ALTER_SERVICE
163 DROP_SERVICE

DDL_SCHEMA_EVENTS

141 CREATE_SCHEMA
142 ALTER_SCHEMA
143 DROP_SCHEMA

DDL_ROUTE_EVENTS

164 CREATE_ROUTE
165 ALTER_ROUTE
166 DROP_ROUTE

DDL_ROLE_EVENTS
-
134 CREATE_ROLE
135 ALTER_ROLE
136 DROP_ROLE

DDL_REMOTE_SERVICE_BINDING_EVENTS
--
174 CREATE_REMOTE_SERVICE_BINDING
175 ALTER_REMOTE_SERVICE_BINDING
176 DROP_REMOTE_SERVICE_BINDING

DDL_QUEUE_EVENTS

157 CREATE_QUEUE
158 ALTER_QUEUE
159 DROP_QUEUE

DDL_PROCEDURE_EVENTS
-
51 CREATE_PROCEDURE
52 ALTER_PROCEDURE
53 DROP_PROCEDURE

DDL_PARTITION_SCHEME_EVENTS

194 CREATE_PARTITION_SCHEME
195 ALTER_PARTITION_SCHEME
196 DROP_PARTITION_SCHEME

DDL_PARTITION_FUNCTION_EVENTS

191 CREATE_PARTITION_FUNCTION
192 ALTER_PARTITION_FUNCTION
193 DROP_PARTITION_FUNCTION

DDL_EVENT_NOTIFICATION_EVENTS
-
74 CREATE_EVENT_NOTIFICATION
76 DROP_EVENT_NOTIFICATION

DDL_ASSEMBLY_EVENTS
--
101 CREATE_ASSEMBLY
102 ALTER_ASSEMBLY
103 DROP_ASSEMBLY

DDL_CONTRACT_EVENTS
--
154 CREATE_CONTRACT
156 DROP_CONTRACT

DDL_FUNCTION_EVENTS

61 CREATE_FUNCTION
62 ALTER_FUNCTION
63 DROP_FUNCTION

DDL_INDEX_EVENTS

24 CREATE_INDEX
25 ALTER_INDEX
26 DROP_INDEX
206 CREATE_XML_INDEX

DDL_MESSAGE_TYPE_EVENTS

151 CREATE_MESSAGE_TYPE
152 ALTER_MESSAGE_TYPE
153 DROP_MESSAGE_TYPE

Denis The SQL Menace

http://sqlservercode.blogspot.com

Hi Denis,

This information is documented in the Books Online topic "Event Groups for Use with DDL Triggers.

http://msdn2.microsoft.com/en-us/library/ms191441.aspx

Regards,

Gail

|||

Thank you, however I would prefer text over an image (So that I can work my copy and paste magic!!)

Denis the SQL Menace

http://sqlservercode.blogspot.com/

DDL Triggers

I know that DDL_LOGIN_EVENTS is the same as CREATE LOGIN, ALTER LOGIN and DROP LOGIN combined but where is this documented?

I have some code here (http://sqlservercode.blogspot.com/2006/08/ddl-trigger-events-revisited.html) that basically shows that you can combine events

But where is this info in BOL?

For example if I do this:

create a trigger and I use DDL_VIEW_EVENTS

CREATE TRIGGER ddlTestEvents
ON DATABASE
FOR DDL_VIEW_EVENTS
AS
PRINT'You must disable Trigger "ddlTestEvents" to drop, create or alter Views!'
ROLLBACK;
GO

After that I would check the sys.triggers and sys.trigger_events views to see what was inserted

SELECT name,te.type,te.type_desc
FROMsys.triggers t
JOINsys.trigger_events te on t.object_id = te.object_id
WHERE t.parent_class=0
AND name IN('ddlTestEvents')
ORDER BY te.type,te.type_desc

In this case 3 rows were inserted

DDL_VIEW_EVENTS
-
41 CREATE_VIEW
42 ALTER_VIEW
43 DROP_VIEW

So here is the complete list for who wants it

DDL_VIEW_EVENTS
-
41 CREATE_VIEW
42 ALTER_VIEW
43 DROP_VIEW

DDL_USER_EVENTS
-
131 CREATE_USER
132 ALTER_USER
133 DROP_USER

DDL_XML_SCHEMA_COLLECTION_EVENTS
-
177 CREATE_XML_SCHEMA_COLLECTION
178 ALTER_XML_SCHEMA_COLLECTION
179 DROP_XML_SCHEMA_COLLECTION

DDL_VIEW_EVENTS
-
41 CREATE_VIEW
42 ALTER_VIEW
43 DROP_VIEW

DDL_TRIGGER_EVENTS
-
71 CREATE_TRIGGER
72 ALTER_TRIGGER
73 DROP_TRIGGER

DDL_USER_EVENTS
-
131 CREATE_USER
132 ALTER_USER
133 DROP_USER

DDL_TYPE_EVENTS
-
91 CREATE_TYPE
93 DROP_TYPE

DDL_TABLE_EVENTS
-
21 CREATE_TABLE
22 ALTER_TABLE
23 DROP_TABLE

DDL_SYNONYM_EVENTS
-
34 CREATE_SYNONYM
36 DROP_SYNONYM

DDL_STATISTICS_EVENTS
--
27 CREATE_STATISTICS
28 UPDATE_STATISTICS
29 DROP_STATISTICS

DDL_SERVICE_EVENTS

161 CREATE_SERVICE
162 ALTER_SERVICE
163 DROP_SERVICE

DDL_SCHEMA_EVENTS

141 CREATE_SCHEMA
142 ALTER_SCHEMA
143 DROP_SCHEMA

DDL_ROUTE_EVENTS

164 CREATE_ROUTE
165 ALTER_ROUTE
166 DROP_ROUTE

DDL_ROLE_EVENTS
-
134 CREATE_ROLE
135 ALTER_ROLE
136 DROP_ROLE

DDL_REMOTE_SERVICE_BINDING_EVENTS
--
174 CREATE_REMOTE_SERVICE_BINDING
175 ALTER_REMOTE_SERVICE_BINDING
176 DROP_REMOTE_SERVICE_BINDING

DDL_QUEUE_EVENTS

157 CREATE_QUEUE
158 ALTER_QUEUE
159 DROP_QUEUE

DDL_PROCEDURE_EVENTS
-
51 CREATE_PROCEDURE
52 ALTER_PROCEDURE
53 DROP_PROCEDURE

DDL_PARTITION_SCHEME_EVENTS

194 CREATE_PARTITION_SCHEME
195 ALTER_PARTITION_SCHEME
196 DROP_PARTITION_SCHEME

DDL_PARTITION_FUNCTION_EVENTS

191 CREATE_PARTITION_FUNCTION
192 ALTER_PARTITION_FUNCTION
193 DROP_PARTITION_FUNCTION

DDL_EVENT_NOTIFICATION_EVENTS
-
74 CREATE_EVENT_NOTIFICATION
76 DROP_EVENT_NOTIFICATION

DDL_ASSEMBLY_EVENTS
--
101 CREATE_ASSEMBLY
102 ALTER_ASSEMBLY
103 DROP_ASSEMBLY

DDL_CONTRACT_EVENTS
--
154 CREATE_CONTRACT
156 DROP_CONTRACT

DDL_FUNCTION_EVENTS

61 CREATE_FUNCTION
62 ALTER_FUNCTION
63 DROP_FUNCTION

DDL_INDEX_EVENTS

24 CREATE_INDEX
25 ALTER_INDEX
26 DROP_INDEX
206 CREATE_XML_INDEX

DDL_MESSAGE_TYPE_EVENTS

151 CREATE_MESSAGE_TYPE
152 ALTER_MESSAGE_TYPE
153 DROP_MESSAGE_TYPE

Denis The SQL Menace

http://sqlservercode.blogspot.com

Hi Denis,

This information is documented in the Books Online topic "Event Groups for Use with DDL Triggers.

http://msdn2.microsoft.com/en-us/library/ms191441.aspx

Regards,

Gail

|||

Thank you, however I would prefer text over an image (So that I can work my copy and paste magic!!)

Denis the SQL Menace

http://sqlservercode.blogspot.com/

Friday, February 24, 2012

dbo's Login Name is blank and can't be edited from Enterprise Manager

We are using SQL Server 2000 SP4. I just created a new database from the EM
but found that in the Users folder under this new db name the Login Name for
dbo was blank. I double-clicked the dbo line and it showed <None> in the
properities dialog box which could not be edited. Is it okay to exe
sp_changedbowner 'sa' sepcially for this new database? Or any better idea?
Thanks,
Eli
> Is it okay to exe sp_changedbowner 'sa' sepcially for this new database?
Yes, sp_changedbowner will fix the database owner. I think it's odd that a
new database would have a NULL owner, though. I usually see that only when
the Windows account that was the database owner is deleted.
Hope this helps.
Dan Guzman
SQL Server MVP
"Eli" <efeng@.kerisys.com> wrote in message
news:%233Pa1LmIIHA.4196@.TK2MSFTNGP04.phx.gbl...
> We are using SQL Server 2000 SP4. I just created a new database from the
> EM
> but found that in the Users folder under this new db name the Login Name
> for
> dbo was blank. I double-clicked the dbo line and it showed <None> in the
> properities dialog box which could not be edited. Is it okay to exe
> sp_changedbowner 'sa' sepcially for this new database? Or any better idea?
> Thanks,
> Eli
>
|||Thanks Dan. It works. Appreciate your meesage.
Regards,
Eli
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:8849D3CB-78AA-42C8-8AA5-9E646991CDFC@.microsoft.com...
> Yes, sp_changedbowner will fix the database owner. I think it's odd that
a
> new database would have a NULL owner, though. I usually see that only
when[vbcol=seagreen]
> the Windows account that was the database owner is deleted.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Eli" <efeng@.kerisys.com> wrote in message
> news:%233Pa1LmIIHA.4196@.TK2MSFTNGP04.phx.gbl...
idea?
>
|||I'm glad I was able to help. Thanks for taking the time to confirm.
Dan Guzman
SQL Server MVP
"Eli" <efeng@.kerisys.com> wrote in message
news:uZ80fLvIIHA.1212@.TK2MSFTNGP05.phx.gbl...
> Thanks Dan. It works. Appreciate your meesage.
> Regards,
> Eli
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:8849D3CB-78AA-42C8-8AA5-9E646991CDFC@.microsoft.com...
> a
> when
> idea?
>

dbo's Login Name is blank and can't be edited from Enterprise Manager

We are using SQL Server 2000 SP4. I just created a new database from the EM
but found that in the Users folder under this new db name the Login Name for
dbo was blank. I double-clicked the dbo line and it showed <None> in the
properities dialog box which could not be edited. Is it okay to exe
sp_changedbowner 'sa' sepcially for this new database? Or any better idea?
Thanks,
Eli> Is it okay to exe sp_changedbowner 'sa' sepcially for this new database?
Yes, sp_changedbowner will fix the database owner. I think it's odd that a
new database would have a NULL owner, though. I usually see that only when
the Windows account that was the database owner is deleted.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Eli" <efeng@.kerisys.com> wrote in message
news:%233Pa1LmIIHA.4196@.TK2MSFTNGP04.phx.gbl...
> We are using SQL Server 2000 SP4. I just created a new database from the
> EM
> but found that in the Users folder under this new db name the Login Name
> for
> dbo was blank. I double-clicked the dbo line and it showed <None> in the
> properities dialog box which could not be edited. Is it okay to exe
> sp_changedbowner 'sa' sepcially for this new database? Or any better idea?
> Thanks,
> Eli
>|||Thanks Dan. It works. Appreciate your meesage.
Regards,
Eli
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:8849D3CB-78AA-42C8-8AA5-9E646991CDFC@.microsoft.com...
> > Is it okay to exe sp_changedbowner 'sa' sepcially for this new database?
> Yes, sp_changedbowner will fix the database owner. I think it's odd that
a
> new database would have a NULL owner, though. I usually see that only
when
> the Windows account that was the database owner is deleted.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Eli" <efeng@.kerisys.com> wrote in message
> news:%233Pa1LmIIHA.4196@.TK2MSFTNGP04.phx.gbl...
> > We are using SQL Server 2000 SP4. I just created a new database from the
> > EM
> > but found that in the Users folder under this new db name the Login Name
> > for
> > dbo was blank. I double-clicked the dbo line and it showed <None> in the
> > properities dialog box which could not be edited. Is it okay to exe
> > sp_changedbowner 'sa' sepcially for this new database? Or any better
idea?
> > Thanks,
> > Eli
> >
> >
>|||I'm glad I was able to help. Thanks for taking the time to confirm.
--
Dan Guzman
SQL Server MVP
"Eli" <efeng@.kerisys.com> wrote in message
news:uZ80fLvIIHA.1212@.TK2MSFTNGP05.phx.gbl...
> Thanks Dan. It works. Appreciate your meesage.
> Regards,
> Eli
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:8849D3CB-78AA-42C8-8AA5-9E646991CDFC@.microsoft.com...
>> > Is it okay to exe sp_changedbowner 'sa' sepcially for this new
>> > database?
>> Yes, sp_changedbowner will fix the database owner. I think it's odd that
> a
>> new database would have a NULL owner, though. I usually see that only
> when
>> the Windows account that was the database owner is deleted.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Eli" <efeng@.kerisys.com> wrote in message
>> news:%233Pa1LmIIHA.4196@.TK2MSFTNGP04.phx.gbl...
>> > We are using SQL Server 2000 SP4. I just created a new database from
>> > the
>> > EM
>> > but found that in the Users folder under this new db name the Login
>> > Name
>> > for
>> > dbo was blank. I double-clicked the dbo line and it showed <None> in
>> > the
>> > properities dialog box which could not be edited. Is it okay to exe
>> > sp_changedbowner 'sa' sepcially for this new database? Or any better
> idea?
>> > Thanks,
>> > Eli
>> >
>> >
>

dbo's Login Name is blank and can't be edited from Enterprise Manager

We are using SQL Server 2000 SP4. I just created a new database from the EM
but found that in the Users folder under this new db name the Login Name for
dbo was blank. I double-clicked the dbo line and it showed <None> in the
properities dialog box which could not be edited. Is it okay to exe
sp_changedbowner 'sa' sepcially for this new database? Or any better idea?
Thanks,
Eli> Is it okay to exe sp_changedbowner 'sa' sepcially for this new database?
Yes, sp_changedbowner will fix the database owner. I think it's odd that a
new database would have a NULL owner, though. I usually see that only when
the Windows account that was the database owner is deleted.
Hope this helps.
Dan Guzman
SQL Server MVP
"Eli" <efeng@.kerisys.com> wrote in message
news:%233Pa1LmIIHA.4196@.TK2MSFTNGP04.phx.gbl...
> We are using SQL Server 2000 SP4. I just created a new database from the
> EM
> but found that in the Users folder under this new db name the Login Name
> for
> dbo was blank. I double-clicked the dbo line and it showed <None> in the
> properities dialog box which could not be edited. Is it okay to exe
> sp_changedbowner 'sa' sepcially for this new database? Or any better idea?
> Thanks,
> Eli
>|||Thanks Dan. It works. Appreciate your meesage.
Regards,
Eli
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:8849D3CB-78AA-42C8-8AA5-9E646991CDFC@.microsoft.com...
> Yes, sp_changedbowner will fix the database owner. I think it's odd that
a
> new database would have a NULL owner, though. I usually see that only
when
> the Windows account that was the database owner is deleted.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Eli" <efeng@.kerisys.com> wrote in message
> news:%233Pa1LmIIHA.4196@.TK2MSFTNGP04.phx.gbl...
idea?[vbcol=seagreen]
>|||I'm glad I was able to help. Thanks for taking the time to confirm.
Dan Guzman
SQL Server MVP
"Eli" <efeng@.kerisys.com> wrote in message
news:uZ80fLvIIHA.1212@.TK2MSFTNGP05.phx.gbl...
> Thanks Dan. It works. Appreciate your meesage.
> Regards,
> Eli
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:8849D3CB-78AA-42C8-8AA5-9E646991CDFC@.microsoft.com...
> a
> when
> idea?
>

dbo with user name in "users"

Using SS2000 SP4. Under "Users" in EM, I see "dbo" in the name column and in
the login name column a name like "webapp". In other databases, I see "dbo"
in the name column and nothing in the login name column.
What is the significance of having another user like "webapp" in the login
name column? And how could can I assign another user login to dbo?
Thanks,
--
Dan D.Dan
DBO is a priviliged user. There are difference between LOGIN and USER.
BOL has pertty good article about it
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:C8FC2930-1CC2-4BEF-BACA-C292396E498E@.microsoft.com...
> Using SS2000 SP4. Under "Users" in EM, I see "dbo" in the name column and
> in
> the login name column a name like "webapp". In other databases, I see
> "dbo"
> in the name column and nothing in the login name column.
> What is the significance of having another user like "webapp" in the login
> name column? And how could can I assign another user login to dbo?
> Thanks,
> --
> Dan D.|||I've read BOL but I don't see anything that explains how a user ends up in
the "login name" column for "dbo" in the "users" part of EM. Sometimes "sa"
is in the "login name" column for "dbo", sometimes the "login name" column
for "dbo" is empty and sometimes, there is another user name in the "login
name" column for "dbo".
--
Dan D.
"Uri Dimant" wrote:

> Dan
> DBO is a priviliged user. There are difference between LOGIN and USER.
> BOL has pertty good article about it
>
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:C8FC2930-1CC2-4BEF-BACA-C292396E498E@.microsoft.com...
>
>|||Dan
You can add user to db_owner database fixed role and all objects will be
created as dbo.tablename ( If he/she is a member of sysadmin server role)
If he/she isn't you needs to specify
create table dbo.table (col1 int)
Waht does that mean "sometimes"? Can you reproduce the problem?
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:913FEB8F-7EE7-4161-8EBA-54D71DBA6314@.microsoft.com...[vbcol=seagreen]
> I've read BOL but I don't see anything that explains how a user ends up in
> the "login name" column for "dbo" in the "users" part of EM. Sometimes
> "sa"
> is in the "login name" column for "dbo", sometimes the "login name" column
> for "dbo" is empty and sometimes, there is another user name in the "login
> name" column for "dbo".
> --
> Dan D.
>
> "Uri Dimant" wrote:
>|||"Uri Dimant" wrote:

> Dan
> You can add user to db_owner database fixed role and all objects will be
> created as dbo.tablename ( If he/she is a member of sysadmin server role)
> If he/she isn't you needs to specify
> create table dbo.table (col1 int)
This I understand.

> Waht does that mean "sometimes"? Can you reproduce the problem?
If I create a new database, my name will show up in the "login name" column
for "dbo". That would explain some of what I see. But as I look through
different databases I see a lot of different users in the "login name" colum
n
for "dbo" in the "login" column. In one database, the "login name" column fo
r
"dbo" will be empty. In another database, a user called "jbanner" will be in
the "login name" column for "dbo". In another database, "sa" will be in the
"login name" column for "dbo". In another database "domain\tbrown" will be i
n
the "login name" column for "dbo".
Some of these users are used for applications only, and it's highly unlikely
that someone logged on as the user and created a database so there must be
some other way that it happens.
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:913FEB8F-7EE7-4161-8EBA-54D71DBA6314@.microsoft.com...
>
>|||Hi Dan
The login name column should show the login name who is considered the owner
of the database, whose user name will be 'dbo' when they use the database. I
don't know why EM is sometimes showing a blank here. There should always be
a mapped login name. One guess is that the login of the owner is a domain
account, and the domain is not available to validate the name. You can try
to verify that by run sp_helpdb in a query window, and seeing what gets
listed for the owner of the database.
You can change the login name that owns a database by using a query window.
Use the database, and run the following:
EXEC sp_changedbowner '<new_owner_login_name>'
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:C8FC2930-1CC2-4BEF-BACA-C292396E498E@.microsoft.com...
> Using SS2000 SP4. Under "Users" in EM, I see "dbo" in the name column and
> in
> the login name column a name like "webapp". In other databases, I see
> "dbo"
> in the name column and nothing in the login name column.
> What is the significance of having another user like "webapp" in the login
> name column? And how could can I assign another user login to dbo?
> Thanks,
> --
> Dan D.|||When I run sp_helpdb on the database with a blank in the "login name" column
for dbo, I get an error: "cannot insert the value NULL into column '', table
''; column does not allow nulls. INSERT fails. I changed the dbowner to 'sa'
and it then worked correctly.
The other databases respond appropriately.
I do have some databases with a domain user as owner so I don't think the
domain is the problem.
In a database for an application, could I assign the database owner as a
user with limited (read/write) rights? Or would making the user the database
owner override the read/write permissions?
Thanks,
--
Dan D.
"Kalen Delaney" wrote:

> Hi Dan
> The login name column should show the login name who is considered the own
er
> of the database, whose user name will be 'dbo' when they use the database.
I
> don't know why EM is sometimes showing a blank here. There should always b
e
> a mapped login name. One guess is that the login of the owner is a domain
> account, and the domain is not available to validate the name. You can try
> to verify that by run sp_helpdb in a query window, and seeing what gets
> listed for the owner of the database.
> You can change the login name that owns a database by using a query window
.
> Use the database, and run the following:
> EXEC sp_changedbowner '<new_owner_login_name>'
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.solidqualitylearning.com
>
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:C8FC2930-1CC2-4BEF-BACA-C292396E498E@.microsoft.com...
>
>|||Dan
I have seen that problem with the NULL error message, and I still believe it
has something to do with not being able to validate the login. Other domain
logins might be able to be validated, or might be using cached credentials,
or something. But as you found, changing the owner to sa is usually a great
solution.
The owner of a database always has the user name dbo in the database, which
always give her full permissions. If you don't want that login to have full
permission, give ownership of the database to someone else.
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:841A0E2F-8DBE-437F-8661-2CFF7998404E@.microsoft.com...[vbcol=seagreen]
> When I run sp_helpdb on the database with a blank in the "login name"
> column
> for dbo, I get an error: "cannot insert the value NULL into column '',
> table
> ''; column does not allow nulls. INSERT fails. I changed the dbowner to
> 'sa'
> and it then worked correctly.
> The other databases respond appropriately.
> I do have some databases with a domain user as owner so I don't think the
> domain is the problem.
> In a database for an application, could I assign the database owner as a
> user with limited (read/write) rights? Or would making the user the
> database
> owner override the read/write permissions?
> Thanks,
> --
> Dan D.
>
> "Kalen Delaney" wrote:
>|||We've had some developers leave recently and I removed their logins. It migh
t
be that one of them owned the database and because the login/user has been
removed the system can't validate them anymore. I thought the system always
asked to reassign the object in that case but maybe not.
Thanks Kalen,
--
Dan D.
"Kalen Delaney" wrote:

> Dan
> I have seen that problem with the NULL error message, and I still believe
it
> has something to do with not being able to validate the login. Other domai
n
> logins might be able to be validated, or might be using cached credentials
,
> or something. But as you found, changing the owner to sa is usually a grea
t
> solution.
> The owner of a database always has the user name dbo in the database, whic
h
> always give her full permissions. If you don't want that login to have ful
l
> permission, give ownership of the database to someone else.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.solidqualitylearning.com
>
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:841A0E2F-8DBE-437F-8661-2CFF7998404E@.microsoft.com...
>
>|||You can identify databases invalid owners with the following query:
SELECT name
FROM master..sysdatabases
WHERE SUSER_SNAME(sid) IS NULL
Execute sp_changedbowner for the problem databases.

> We've had some developers leave recently and I removed their logins. It
> might
> be that one of them owned the database and because the login/user has been
> removed the system can't validate them anymore. I thought the system
> always
> asked to reassign the object in that case but maybe not.
The check for database ownership is done when you drop a standard login
(sp_droplogin) but not when you remove Windows logins (sp_revokelogin). In
fact, you can have a Windows login own a database even when no corresponding
login exists in SQL Server. This is often the case when an administrator
connects to SQL Server via BUILTIJN\Administrators group membership and then
creates, restores or attaches a database. The database is then owned by the
individual's Windows account. However, the database owner becomes invalid
if the Windows account is later deleted.
Hope this helps.
Dan Guzman
SQL Server MVP
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:9B68CC18-5C0F-47E0-BB0E-276A7C92569A@.microsoft.com...[vbcol=seagreen]
> We've had some developers leave recently and I removed their logins. It
> might
> be that one of them owned the database and because the login/user has been
> removed the system can't validate them anymore. I thought the system
> always
> asked to reassign the object in that case but maybe not.
> Thanks Kalen,
> --
> Dan D.
>
> "Kalen Delaney" wrote:
>

Sunday, February 19, 2012

dbo resetting

Hi!
How to reset "Login Name" from dbo user to "None" ?
Thanks!!!!Dmitry
Did you mean by sp_change_user system stored procedure?
"Dmitry Karneyev" <karneyev@.msn.com> wrote in message
news:upVTV0VxDHA.1740@.TK2MSFTNGP09.phx.gbl...
> Hi!
> How to reset "Login Name" from dbo user to "None" ?
> Thanks!!!!
>|||The login mapping for the 'dbo' user is determined by database ownership.
You can specify the desired owner with sp_changedbowner:
USE MyDatabase
EXEC sp_changedbowner 'sa'
Note that the specified login must be a valid login.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Dmitry Karneyev" <karneyev@.msn.com> wrote in message
news:upVTV0VxDHA.1740@.TK2MSFTNGP09.phx.gbl...
> Hi!
> How to reset "Login Name" from dbo user to "None" ?
> Thanks!!!!
>|||Thanks guys it helped!
But when I'm creating database in server which is only windows auth allowed
dbo user login switches to my AD account.
If server allows both types of auth then dbo login name is <None> (in
properties window in ent manager)
I changed dbo login to sa but wanted to do <None>
Any ideas?
"Dmitry Karneyev" <karneyev@.msn.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:upVTV0VxDHA.1740@.TK2MSFTNGP09.phx.gbl...
> Hi!
> How to reset "Login Name" from dbo user to "None" ?
> Thanks!!!!
>|||> But when I'm creating database in server which is only windows auth
allowed
> dbo user login switches to my AD account.
> If server allows both types of auth then dbo login name is <None> (in
> properties window in ent manager)
Are you creating a new database or attaching/restoring? In the case of a
create, I would expect the owner to be your current login, regardless of the
server authentication mode. However, the database owner following
restore/attach may not get set properly and sp_changedbowner can be used to
properly map the user.
If the 'dbo' user login shows as '<None>', this can cause problems because
SQL Server expects the login/user mapping to be properly set.
> I changed dbo login to sa but wanted to do <None>
Why do you want to do this? Is there some reason you don't want to specify
a valid login as the database owner.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Dmitry Karneyev" <karneyev@.msn.com> wrote in message
news:uqOn32WxDHA.3408@.tk2msftngp13.phx.gbl...
> Thanks guys it helped!
> But when I'm creating database in server which is only windows auth
allowed
> dbo user login switches to my AD account.
> If server allows both types of auth then dbo login name is <None> (in
> properties window in ent manager)
> I changed dbo login to sa but wanted to do <None>
> Any ideas?
> "Dmitry Karneyev" <karneyev@.msn.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ:
> news:upVTV0VxDHA.1740@.TK2MSFTNGP09.phx.gbl...
> > Hi!
> > How to reset "Login Name" from dbo user to "None" ?
> >
> > Thanks!!!!
> >
> >
>|||Sorry for previous misinformation.
I guess I'm gonna understand when and why EM shows <None>.
It doesn't depent on auth mode (you are right)
It shows <None> when database creators login doesn't attached to
Security/Logins section.
Dmitry
"Dan Guzman" <danguzman@.nospam-earthlink.net> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:uxMOBHXxDHA.1060@.TK2MSFTNGP12.phx.gbl...
> > But when I'm creating database in server which is only windows auth
> allowed
> > dbo user login switches to my AD account.
> > If server allows both types of auth then dbo login name is <None> (in
> > properties window in ent manager)
> Are you creating a new database or attaching/restoring? In the case of a
> create, I would expect the owner to be your current login, regardless of
the
> server authentication mode. However, the database owner following
> restore/attach may not get set properly and sp_changedbowner can be used
to
> properly map the user.
> If the 'dbo' user login shows as '<None>', this can cause problems because
> SQL Server expects the login/user mapping to be properly set.
> > I changed dbo login to sa but wanted to do <None>
> Why do you want to do this? Is there some reason you don't want to
specify
> a valid login as the database owner.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
>
> "Dmitry Karneyev" <karneyev@.msn.com> wrote in message
> news:uqOn32WxDHA.3408@.tk2msftngp13.phx.gbl...
> > Thanks guys it helped!
> > But when I'm creating database in server which is only windows auth
> allowed
> > dbo user login switches to my AD account.
> > If server allows both types of auth then dbo login name is <None> (in
> > properties window in ent manager)
> >
> > I changed dbo login to sa but wanted to do <None>
> >
> > Any ideas?
> >
> > "Dmitry Karneyev" <karneyev@.msn.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
> ÓÌÅÄÕÀÝÅÅ:
> > news:upVTV0VxDHA.1740@.TK2MSFTNGP09.phx.gbl...
> > > Hi!
> > > How to reset "Login Name" from dbo user to "None" ?
> > >
> > > Thanks!!!!
> > >
> > >
> >
> >
>

dbo permissions

Is it possible for the dbo account to have a login to an SQL server?
If so how can that be discontinued?dbo is a special user account that exists in every database
but there isn't a login named dbo.
The login that owns the database is has the name DBO in that
database.
It's easier to not think of dbo as an user account as it
doesn't have a login and doesn't work like a typical user in
a database.
One other note on the login and hope this doesn't confuse
things but dbo isn't a login based on the special account
that exists in all databases. By default and generally on
most SQL Servers there is no login dbo. In theory you can
create a SQL login named dbo but it's not the same thing.
isn't a good practice and confuses things quite a bit. I saw
one place do that before...not a good thing to create
something like that.
-Sue
On Wed, 21 Sep 2005 13:39:08 -0400, "robertcp"
<rplance@.bmhsc.org> wrote:

>Is it possible for the dbo account to have a login to an SQL server?
>If so how can that be discontinued?
>|||To add to Sue's response, it is possible to create a SQL login that is used
only for database ownership and then change database ownership to that
login. Only that login will map to the 'dbo' user. However, note that
sysadmin role members are 'dbo' in all databases.
USE MyDatabase
DECLARE @.StrongPassword sysname
SET @.StrongPassword = NEWID()
EXEC sp_addlogin 'DatabaseOwner', @.StrongPassword
EXEC sp_changedbowner 'DatabaseOwner'
Hope this helps.
Dan Guzman
SQL Server MVP
"robertcp" <rplance@.bmhsc.org> wrote in message
news:eUQ9fNtvFHA.1988@.TK2MSFTNGP10.phx.gbl...
> Is it possible for the dbo account to have a login to an SQL server?
> If so how can that be discontinued?
>

'dbo' mapped to non-existent login - what to do? (SQL 2000)

Hello,
If I restore a database backup from a foreign system (separate SQL Server in
a separate domain) then the result of:
sp_helpuser @.name_in_db = 'dbo'
is:
UserName GroupName LoginName SID
-- -- --
dbo db_owner NULL <SID>
Hence, 'dbo' is mapped to NULL.
It causes problems if Cross DB Ownership Chaining is enabled, because dbo in
different databases is mapped to different logins.
What is the right way to correct this problem?
So far, I have performed an ad-hoc update to system table sysusers setting
the sid for 'dbo' user to the correct value:
update sysusers set sid = <SID> where name ='dbo' (<SID> retrieved from
master..syslogins table)
But I've got a feeling this is not the right way...
What should I do?
Thank you for your help!
Best regards,
AndrewHave you used sp_changedbowner before Andrew? provided the id is not a user
in the database, this will changed the dbo.
Chris Wood
"Andrew Drake" <andrewdrake@.hotmail.com> wrote in message
news:eyKune6kGHA.1028@.TK2MSFTNGP04.phx.gbl...
> Hello,
> If I restore a database backup from a foreign system (separate SQL Server
> in
> a separate domain) then the result of:
> sp_helpuser @.name_in_db = 'dbo'
> is:
> UserName GroupName LoginName SID
> -- -- --
> dbo db_owner NULL <SID>
> Hence, 'dbo' is mapped to NULL.
> It causes problems if Cross DB Ownership Chaining is enabled, because dbo
> in
> different databases is mapped to different logins.
>
> What is the right way to correct this problem?
>
> So far, I have performed an ad-hoc update to system table sysusers setting
> the sid for 'dbo' user to the correct value:
> update sysusers set sid = <SID> where name ='dbo' (<SID> retrieved from
> master..syslogins table)
> But I've got a feeling this is not the right way...
> What should I do?
> Thank you for your help!
> Best regards,
> Andrew
>
>
>|||You're feeling is right, don't update the system tables. Use sp_changedbowner instead.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Andrew Drake" <andrewdrake@.hotmail.com> wrote in message
news:eyKune6kGHA.1028@.TK2MSFTNGP04.phx.gbl...
> Hello,
> If I restore a database backup from a foreign system (separate SQL Server in
> a separate domain) then the result of:
> sp_helpuser @.name_in_db = 'dbo'
> is:
> UserName GroupName LoginName SID
> -- -- --
> dbo db_owner NULL <SID>
> Hence, 'dbo' is mapped to NULL.
> It causes problems if Cross DB Ownership Chaining is enabled, because dbo in
> different databases is mapped to different logins.
>
> What is the right way to correct this problem?
>
> So far, I have performed an ad-hoc update to system table sysusers setting
> the sid for 'dbo' user to the correct value:
> update sysusers set sid = <SID> where name ='dbo' (<SID> retrieved from
> master..syslogins table)
> But I've got a feeling this is not the right way...
> What should I do?
> Thank you for your help!
> Best regards,
> Andrew
>
>
>|||Gentlemen:
Thank you very much for your help.
The funny thing is that the owner of the database is set correctly (e.g. in
the Enterprise Manager --> database properties --> 'General' tab),
only the mapping of 'dbo' users is missing (i.e. 'dbo' is mapped to NULL).
Therefore I haven't use sp_changedbowner, but I will give it a try next
time.
Thanks a lot again!
Best regards,
Andrew
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eKvkNp6kGHA.4224@.TK2MSFTNGP05.phx.gbl...
> You're feeling is right, don't update the system tables. Use
> sp_changedbowner instead.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>|||This hopefully explains it:
The owner of a data is stored in two places. It is stored in a system table in the master database
(sysdatabases), but it is also reflected in sysusers.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Andrew Drake" <andrewdrake@.hotmail.com> wrote in message
news:%23peUt66kGHA.4044@.TK2MSFTNGP03.phx.gbl...
> Gentlemen:
> Thank you very much for your help.
> The funny thing is that the owner of the database is set correctly (e.g. in
> the Enterprise Manager --> database properties --> 'General' tab),
> only the mapping of 'dbo' users is missing (i.e. 'dbo' is mapped to NULL).
> Therefore I haven't use sp_changedbowner, but I will give it a try next
> time.
> Thanks a lot again!
> Best regards,
> Andrew
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:eKvkNp6kGHA.4224@.TK2MSFTNGP05.phx.gbl...
>> You're feeling is right, don't update the system tables. Use
>> sp_changedbowner instead.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>
>

'dbo' mapped to non-existent login - what to do? (SQL 2000)

Have you used sp_changedbowner before Andrew? provided the id is not a user
in the database, this will changed the dbo.
Chris Wood
"Andrew Drake" <andrewdrake@.hotmail.com> wrote in message
news:eyKune6kGHA.1028@.TK2MSFTNGP04.phx.gbl...
> Hello,
> If I restore a database backup from a foreign system (separate SQL Server
> in
> a separate domain) then the result of:
> sp_helpuser @.name_in_db = 'dbo'
> is:
> UserName GroupName LoginName SID
> -- -- --
> dbo db_owner NULL <SID>
> Hence, 'dbo' is mapped to NULL.
> It causes problems if Cross DB Ownership Chaining is enabled, because dbo
> in
> different databases is mapped to different logins.
>
> What is the right way to correct this problem?
>
> So far, I have performed an ad-hoc update to system table sysusers setting
> the sid for 'dbo' user to the correct value:
> update sysusers set sid = <SID> where name ='dbo' (<SID> retrieved from
> master..syslogins table)
> But I've got a feeling this is not the right way...
> What should I do?
> Thank you for your help!
> Best regards,
> Andrew
>
>
>You're feeling is right, don't update the system tables. Use sp_changedbowne
r instead.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Andrew Drake" <andrewdrake@.hotmail.com> wrote in message
news:eyKune6kGHA.1028@.TK2MSFTNGP04.phx.gbl...
> Hello,
> If I restore a database backup from a foreign system (separate SQL Server
in
> a separate domain) then the result of:
> sp_helpuser @.name_in_db = 'dbo'
> is:
> UserName GroupName LoginName SID
> -- -- --
> dbo db_owner NULL <SID>
> Hence, 'dbo' is mapped to NULL.
> It causes problems if Cross DB Ownership Chaining is enabled, because dbo
in
> different databases is mapped to different logins.
>
> What is the right way to correct this problem?
>
> So far, I have performed an ad-hoc update to system table sysusers setting
> the sid for 'dbo' user to the correct value:
> update sysusers set sid = <SID> where name ='dbo' (<SID> retrieved from
> master..syslogins table)
> But I've got a feeling this is not the right way...
> What should I do?
> Thank you for your help!
> Best regards,
> Andrew
>
>
>|||Gentlemen:
Thank you very much for your help.
The funny thing is that the owner of the database is set correctly (e.g. in
the Enterprise Manager --> database properties --> 'General' tab),
only the mapping of 'dbo' users is missing (i.e. 'dbo' is mapped to NULL).
Therefore I haven't use sp_changedbowner, but I will give it a try next
time.
Thanks a lot again!
Best regards,
Andrew
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eKvkNp6kGHA.4224@.TK2MSFTNGP05.phx.gbl...
> You're feeling is right, don't update the system tables. Use
> sp_changedbowner instead.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>|||This hopefully explains it:
The owner of a data is stored in two places. It is stored in a system table
in the master database
(sysdatabases), but it is also reflected in sysusers.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Andrew Drake" <andrewdrake@.hotmail.com> wrote in message
news:%23peUt66kGHA.4044@.TK2MSFTNGP03.phx.gbl...
> Gentlemen:
> Thank you very much for your help.
> The funny thing is that the owner of the database is set correctly (e.g. i
n
> the Enterprise Manager --> database properties --> 'General' tab),
> only the mapping of 'dbo' users is missing (i.e. 'dbo' is mapped to NULL).
> Therefore I haven't use sp_changedbowner, but I will give it a try next
> time.
> Thanks a lot again!
> Best regards,
> Andrew
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n
> message news:eKvkNp6kGHA.4224@.TK2MSFTNGP05.phx.gbl...
>
>|||Hello,
If I restore a database backup from a foreign system (separate SQL Server in
a separate domain) then the result of:
sp_helpuser @.name_in_db = 'dbo'
is:
UserName GroupName LoginName SID
-- -- --
dbo db_owner NULL <SID>
Hence, 'dbo' is mapped to NULL.
It causes problems if Cross DB Ownership Chaining is enabled, because dbo in
different databases is mapped to different logins.
What is the right way to correct this problem?
So far, I have performed an ad-hoc update to system table sysusers setting
the sid for 'dbo' user to the correct value:
update sysusers set sid = <SID> where name ='dbo' (<SID> retrieved from
master..syslogins table)
But I've got a feeling this is not the right way...
What should I do?
Thank you for your help!
Best regards,
Andrew|||Have you used sp_changedbowner before Andrew? provided the id is not a user
in the database, this will changed the dbo.
Chris Wood
"Andrew Drake" <andrewdrake@.hotmail.com> wrote in message
news:eyKune6kGHA.1028@.TK2MSFTNGP04.phx.gbl...
> Hello,
> If I restore a database backup from a foreign system (separate SQL Server
> in
> a separate domain) then the result of:
> sp_helpuser @.name_in_db = 'dbo'
> is:
> UserName GroupName LoginName SID
> -- -- --
> dbo db_owner NULL <SID>
> Hence, 'dbo' is mapped to NULL.
> It causes problems if Cross DB Ownership Chaining is enabled, because dbo
> in
> different databases is mapped to different logins.
>
> What is the right way to correct this problem?
>
> So far, I have performed an ad-hoc update to system table sysusers setting
> the sid for 'dbo' user to the correct value:
> update sysusers set sid = <SID> where name ='dbo' (<SID> retrieved from
> master..syslogins table)
> But I've got a feeling this is not the right way...
> What should I do?
> Thank you for your help!
> Best regards,
> Andrew
>
>
>|||You're feeling is right, don't update the system tables. Use sp_changedbowne
r instead.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Andrew Drake" <andrewdrake@.hotmail.com> wrote in message
news:eyKune6kGHA.1028@.TK2MSFTNGP04.phx.gbl...
> Hello,
> If I restore a database backup from a foreign system (separate SQL Server
in
> a separate domain) then the result of:
> sp_helpuser @.name_in_db = 'dbo'
> is:
> UserName GroupName LoginName SID
> -- -- --
> dbo db_owner NULL <SID>
> Hence, 'dbo' is mapped to NULL.
> It causes problems if Cross DB Ownership Chaining is enabled, because dbo
in
> different databases is mapped to different logins.
>
> What is the right way to correct this problem?
>
> So far, I have performed an ad-hoc update to system table sysusers setting
> the sid for 'dbo' user to the correct value:
> update sysusers set sid = <SID> where name ='dbo' (<SID> retrieved from
> master..syslogins table)
> But I've got a feeling this is not the right way...
> What should I do?
> Thank you for your help!
> Best regards,
> Andrew
>
>
>|||Gentlemen:
Thank you very much for your help.
The funny thing is that the owner of the database is set correctly (e.g. in
the Enterprise Manager --> database properties --> 'General' tab),
only the mapping of 'dbo' users is missing (i.e. 'dbo' is mapped to NULL).
Therefore I haven't use sp_changedbowner, but I will give it a try next
time.
Thanks a lot again!
Best regards,
Andrew
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eKvkNp6kGHA.4224@.TK2MSFTNGP05.phx.gbl...
> You're feeling is right, don't update the system tables. Use
> sp_changedbowner instead.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>|||This hopefully explains it:
The owner of a data is stored in two places. It is stored in a system table
in the master database
(sysdatabases), but it is also reflected in sysusers.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Andrew Drake" <andrewdrake@.hotmail.com> wrote in message
news:%23peUt66kGHA.4044@.TK2MSFTNGP03.phx.gbl...
> Gentlemen:
> Thank you very much for your help.
> The funny thing is that the owner of the database is set correctly (e.g. i
n
> the Enterprise Manager --> database properties --> 'General' tab),
> only the mapping of 'dbo' users is missing (i.e. 'dbo' is mapped to NULL).
> Therefore I haven't use sp_changedbowner, but I will give it a try next
> time.
> Thanks a lot again!
> Best regards,
> Andrew
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n
> message news:eKvkNp6kGHA.4224@.TK2MSFTNGP05.phx.gbl...
>
>

dbo login not mapped to sa

Hi,
I have a web task in SQL 7 that is failing and I think it
might have to do with the fact that dbo isn't mapped to sa
in the users of the database, can anyone confirm? I have
recently moved this database into a hardware clustered
environment, I think it may have some to do with the
restore.
Thanks
MegHi,
The stored proc sp_change_users_login exists in sql 7, but
when using it to tie together dbo and sa I get the
following error message "Server: Msg 15287, Level 16,
State 1, Procedure sp_change_users_login, Line 33
Terminating this procedure. 'sa' is a forbidden value for
the login name parameter in this procedure.". I am going
to have a look on technet and the like for this error, but
if anyone has any other suggestions, they are welcome!
Thanks
Meg
>--Original Message--
>Hi,
>I have a web task in SQL 7 that is failing and I think it
>might have to do with the fact that dbo isn't mapped to
sa
>in the users of the database, can anyone confirm? I have
>recently moved this database into a hardware clustered
>environment, I think it may have some to do with the
>restore.
>Thanks
>Meg
>.
>|||The dbo user is a special case regarding login mapping. Database
ownership determines the login mapped to the dbo user. You can use
sp_changedbowner to specify the desired owner. This should be standard
procedure after a restore or attach from another server:
USE MyDatabase
EXEC sp_changedbowner 'sa'
GO
In some cases, you may get the ambiguous error 'the proposed owner is
already a user in the database'. In this case, you can workaround the
problem by temporarily changing ownership to a non-conflicting login:
USE MyDatabase
EXEC sp_addlogin 'TempOwner'
EXEC sp_changedbowner 'TempOwner'
EXEC sp_changedbowner 'sa'
EXEC sp_droplogin 'TempOwner'
GO
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"meg" <meg.neeson@.barclays.co.uk> wrote in message
news:09f201c35db3$87af5610$a401280a@.phx.gbl...
> Hi,
> The stored proc sp_change_users_login exists in sql 7, but
> when using it to tie together dbo and sa I get the
> following error message "Server: Msg 15287, Level 16,
> State 1, Procedure sp_change_users_login, Line 33
> Terminating this procedure. 'sa' is a forbidden value for
> the login name parameter in this procedure.". I am going
> to have a look on technet and the like for this error, but
> if anyone has any other suggestions, they are welcome!
> Thanks
> Meg
> >--Original Message--
> >Hi,
> >
> >I have a web task in SQL 7 that is failing and I think it
> >might have to do with the fact that dbo isn't mapped to
> sa
> >in the users of the database, can anyone confirm? I have
> >recently moved this database into a hardware clustered
> >environment, I think it may have some to do with the
> >restore.
> >
> >Thanks
> >Meg
> >.
> >

dbo login name wrong after copy

Just copied all databases, from Windows NT4 with SQL 7 in a domain to a new Windows 2000 with SQL 2000 in workgroup, with the SQL 2000 copy database wizard.
Now a few databases still have a dbo with login name DOMAINNAME/Administrator while this domain doesn't exist anymore in a few weeks from now
1. Can I get a problem when I don't resolve this
2. Is there a way to give the dbo the sa login name"Nico" <anonymous@.discussions.microsoft.com> wrote in message
news:84E0FEA3-50AB-400F-981A-9C53951002E5@.microsoft.com...
> Just copied all databases, from Windows NT4 with SQL 7 in a domain to a
new Windows 2000 with SQL 2000 in workgroup, with the SQL 2000 copy database
wizard.
> Now a few databases still have a dbo with login name
DOMAINNAME/Administrator while this domain doesn't exist anymore in a few
weeks from now.
> 1. Can I get a problem when I don't resolve this?
> 2. Is there a way to give the dbo the sa login name?
First off, 'dbo' is a database role, not a user. A role is like a group in
Windows. Anyone you assign to the dbo role in a database can do anything
they want in that database.
'sysadmin' is a server role that can do anything anywhere in your SQL server
(and so is like a super dbo, if you like). By default, the local admin
group and the user sa are both assigned to the sysadmin role, and so can
both act as the dbo of a database (plus additional actions). So there is no
need to add sa to the dbo as it is already more powerful than dbo.
Any other user that you want to have dbo access just add them to the
appropriate database's dbo role. If your DOMAIN/Administrator is going,
then leaving the login there won't be a problem, as no-one will be able to
use it (though for completeness you might want to remove it). You can add
as many other accounts as you feel is safe to the dbo role.
Bob
--
Warning: Do not look into the light sabre whilst switching it on
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.541 / Virus Database: 335 - Release Date: 14/11/2003|||> First off, 'dbo' is a database role, not a user.
Actually 'dbo' is a database user and is required in every SQL Server
database. Unlike other database users, the login mapping for the 'dbo'
user is determined by database ownership.
This should not be confused with user membership of the db_owner fixed
database role. Members of the db_owner role have similar permissions as
the 'dbo' role but are not mapped to the 'dbo' user. Members of the
sysadmin server role automatically impersonate the 'dbo' user in all
databases, even though their login is not necessarily mapped to the
'dbo' user.
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"Bob Simms" <bob_simms@.somewhere.com> wrote in message
news:NjItb.1924$1u4.548@.news-binary.blueyonder.co.uk...
> "Nico" <anonymous@.discussions.microsoft.com> wrote in message
> news:84E0FEA3-50AB-400F-981A-9C53951002E5@.microsoft.com...
> > Just copied all databases, from Windows NT4 with SQL 7 in a domain
to a
> new Windows 2000 with SQL 2000 in workgroup, with the SQL 2000 copy
database
> wizard.
> > Now a few databases still have a dbo with login name
> DOMAINNAME/Administrator while this domain doesn't exist anymore in a
few
> weeks from now.
> > 1. Can I get a problem when I don't resolve this?
> > 2. Is there a way to give the dbo the sa login name?
> First off, 'dbo' is a database role, not a user. A role is like a
group in
> Windows. Anyone you assign to the dbo role in a database can do
anything
> they want in that database.
> 'sysadmin' is a server role that can do anything anywhere in your SQL
server
> (and so is like a super dbo, if you like). By default, the local
admin
> group and the user sa are both assigned to the sysadmin role, and so
can
> both act as the dbo of a database (plus additional actions). So there
is no
> need to add sa to the dbo as it is already more powerful than dbo.
> Any other user that you want to have dbo access just add them to the
> appropriate database's dbo role. If your DOMAIN/Administrator is
going,
> then leaving the login there won't be a problem, as no-one will be
able to
> use it (though for completeness you might want to remove it). You can
add
> as many other accounts as you feel is safe to the dbo role.
> Bob
> --
> Warning: Do not look into the light sabre whilst switching it on
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.541 / Virus Database: 335 - Release Date: 14/11/2003
>|||You can change database ownership to 'sa' with sp_changedbowner:
USE MyDatabase
EXEC sp_changedbowner 'sa'
GO
If you're not running SQL 2000 SP3, you may get an erroneous error
stating that the proposed owner is already a user in the database. In
that case, temporarily change ownership to a non-conflicting login:
USE MyDatabase
EXEC sp_addlogin 'TempOwner'
EXEC sp_changedbowner 'TempOwner'
EXEC sp_changedbowner 'sa'
EXEC sp_droplogin 'TempOwner'
GO
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"Nico" <anonymous@.discussions.microsoft.com> wrote in message
news:84E0FEA3-50AB-400F-981A-9C53951002E5@.microsoft.com...
> Just copied all databases, from Windows NT4 with SQL 7 in a domain to
a new Windows 2000 with SQL 2000 in workgroup, with the SQL 2000 copy
database wizard.
> Now a few databases still have a dbo with login name
DOMAINNAME/Administrator while this domain doesn't exist anymore in a
few weeks from now.
> 1. Can I get a problem when I don't resolve this?
> 2. Is there a way to give the dbo the sa login name?
>|||Ok. I've changed the dbowner to sa. No problem when I look at the properties of the database.
Still I've got the user dbo with login DOMAINNAME/Administrator. Is there a possibility to change the dbo login to sa?|||sp_change_users_login?
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Nico" <nvk@.galvano.nl> wrote in message news:A5285328-1CBE-47E9-BC5F-428460D9F8FC@.microsoft.com...
> Ok. I've changed the dbowner to sa. No problem when I look at the properties of the database.
> Still I've got the user dbo with login DOMAINNAME/Administrator. Is there a possibility to change
the dbo login to sa?|||Tried this before:
dbo is a forbidden value.
See also books online says sa and dbo cannot be used.
Another suggestion?|||How did you change the owner? sp_changedbowner?
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Nico" <anonymous@.discussions.microsoft.com> wrote in message
news:0E3B442E-0722-4D65-9E54-2DC90AE18C29@.microsoft.com...
> Tried this before:
> dbo is a forbidden value.
> See also books online says sa and dbo cannot be used.
> Another suggestion?|||Perhaps this is an Enterprise Manager refresh issue. Does sp_helpdb
'MyDatabase' return the correct owner?
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"Nico" <nvk@.galvano.nl> wrote in message
news:A5285328-1CBE-47E9-BC5F-428460D9F8FC@.microsoft.com...
> Ok. I've changed the dbowner to sa. No problem when I look at the
properties of the database.
> Still I've got the user dbo with login DOMAINNAME/Administrator. Is
there a possibility to change the dbo login to sa?|||Yes, this works fine when I look at the database properties
Just found out a procedure to solve the problem
1. detach database (Query Analyser
2. copy mdf and ldf files (Explorer
3. create database (Query Analyser
4. Delete database (Enterprise Manager
5. copy back mdf and ldf files (Explorer
6. attach database (Query Analyser
Now the dbo user has login name of sa (login name Query Analyser when created database).

dbo does not have a login name..

Hi
In one of the databases, dbo users under Users option does not have the
login name.Is there any way to assign a login name "sa" to dbo.
Thanks and Regards
Jagminder
sp_changedbowner
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jagminder Chugh" <JagminderChugh@.discussions.microsoft.com> wrote in message
news:3250D5AC-F964-4BD7-8C09-C0773AD46721@.microsoft.com...
> Hi
> In one of the databases, dbo users under Users option does not have the
> login name.Is there any way to assign a login name "sa" to dbo.
> Thanks and Regards
> Jagminder
|||when i try that it says,
Cannot change the owner of the master database.
"Tibor Karaszi" wrote:

> sp_changedbowner
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Jagminder Chugh" <JagminderChugh@.discussions.microsoft.com> wrote in message
> news:3250D5AC-F964-4BD7-8C09-C0773AD46721@.microsoft.com...
>
>
|||Are you saying that it is the *master* database that doesn't have an owner? That shouldn't be
possible. The proc changes the owner for the current database, so you need to USE the database you
want to change owner for first. See Books Online for details on how to use this procedure.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jagminder Chugh" <JagminderChugh@.discussions.microsoft.com> wrote in message
news:336DF028-34FB-431C-8739-C35C9FBF7460@.microsoft.com...[vbcol=seagreen]
> when i try that it says,
> Cannot change the owner of the master database.
> "Tibor Karaszi" wrote:
|||hey tibor, your site is down..
|||Thanks. It was down for a while, but I can reach it now...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mb" <mb@.discussions.microsoft.com> wrote in message
news:CE44A7CB-CD22-41D7-991D-91817BE5D28F@.microsoft.com...
> hey tibor, your site is down..
>
|||Usually that happens when you restore databases from different servers.
Anyway, try running sp_change_users_login. You can find it in the BOL.
Lionel Chacon
"Jagminder Chugh" wrote:

> Hi
> In one of the databases, dbo users under Users option does not have the
> login name.Is there any way to assign a login name "sa" to dbo.
> Thanks and Regards
> Jagminder
|||sp_change_users_login doesn't work for the owner of the database. For that you need to use
sp_changedbowner.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Lionel Chacon" <LionelChacon@.discussions.microsoft.com> wrote in message
news:5C767497-923B-4041-9A25-787C6D5A4801@.microsoft.com...[vbcol=seagreen]
> Usually that happens when you restore databases from different servers.
> Anyway, try running sp_change_users_login. You can find it in the BOL.
> --
> Lionel Chacon
>
> "Jagminder Chugh" wrote:

dbo does not have a login name..

Hi
In one of the databases, dbo users under Users option does not have the
login name.Is there any way to assign a login name "sa" to dbo.
Thanks and Regards
Jagmindersp_changedbowner
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jagminder Chugh" <JagminderChugh@.discussions.microsoft.com> wrote in message
news:3250D5AC-F964-4BD7-8C09-C0773AD46721@.microsoft.com...
> Hi
> In one of the databases, dbo users under Users option does not have the
> login name.Is there any way to assign a login name "sa" to dbo.
> Thanks and Regards
> Jagminder|||when i try that it says,
Cannot change the owner of the master database.
"Tibor Karaszi" wrote:
> sp_changedbowner
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Jagminder Chugh" <JagminderChugh@.discussions.microsoft.com> wrote in message
> news:3250D5AC-F964-4BD7-8C09-C0773AD46721@.microsoft.com...
> > Hi
> > In one of the databases, dbo users under Users option does not have the
> > login name.Is there any way to assign a login name "sa" to dbo.
> >
> > Thanks and Regards
> > Jagminder
>
>|||Are you saying that it is the *master* database that doesn't have an owner? That shouldn't be
possible. The proc changes the owner for the current database, so you need to USE the database you
want to change owner for first. See Books Online for details on how to use this procedure.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jagminder Chugh" <JagminderChugh@.discussions.microsoft.com> wrote in message
news:336DF028-34FB-431C-8739-C35C9FBF7460@.microsoft.com...
> when i try that it says,
> Cannot change the owner of the master database.
> "Tibor Karaszi" wrote:
>> sp_changedbowner
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "Jagminder Chugh" <JagminderChugh@.discussions.microsoft.com> wrote in message
>> news:3250D5AC-F964-4BD7-8C09-C0773AD46721@.microsoft.com...
>> > Hi
>> > In one of the databases, dbo users under Users option does not have the
>> > login name.Is there any way to assign a login name "sa" to dbo.
>> >
>> > Thanks and Regards
>> > Jagminder
>>|||hey tibor, your site is down..|||Thanks. It was down for a while, but I can reach it now...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mb" <mb@.discussions.microsoft.com> wrote in message
news:CE44A7CB-CD22-41D7-991D-91817BE5D28F@.microsoft.com...
> hey tibor, your site is down..
>|||Usually that happens when you restore databases from different servers.
Anyway, try running sp_change_users_login. You can find it in the BOL.
--
Lionel Chacon
"Jagminder Chugh" wrote:
> Hi
> In one of the databases, dbo users under Users option does not have the
> login name.Is there any way to assign a login name "sa" to dbo.
> Thanks and Regards
> Jagminder|||sp_change_users_login doesn't work for the owner of the database. For that you need to use
sp_changedbowner.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Lionel Chacon" <LionelChacon@.discussions.microsoft.com> wrote in message
news:5C767497-923B-4041-9A25-787C6D5A4801@.microsoft.com...
> Usually that happens when you restore databases from different servers.
> Anyway, try running sp_change_users_login. You can find it in the BOL.
> --
> Lionel Chacon
>
> "Jagminder Chugh" wrote:
>> Hi
>> In one of the databases, dbo users under Users option does not have the
>> login name.Is there any way to assign a login name "sa" to dbo.
>> Thanks and Regards
>> Jagminder

dbo does not have a login name..

Hi
In one of the databases, dbo users under Users option does not have the
login name.Is there any way to assign a login name "sa" to dbo.
Thanks and Regards
Jagmindersp_changedbowner
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jagminder Chugh" <JagminderChugh@.discussions.microsoft.com> wrote in messag
e
news:3250D5AC-F964-4BD7-8C09-C0773AD46721@.microsoft.com...
> Hi
> In one of the databases, dbo users under Users option does not have the
> login name.Is there any way to assign a login name "sa" to dbo.
> Thanks and Regards
> Jagminder|||when i try that it says,
Cannot change the owner of the master database.
"Tibor Karaszi" wrote:

> sp_changedbowner
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Jagminder Chugh" <JagminderChugh@.discussions.microsoft.com> wrote in mess
age
> news:3250D5AC-F964-4BD7-8C09-C0773AD46721@.microsoft.com...
>
>|||Are you saying that it is the *master* database that doesn't have an owner?
That shouldn't be
possible. The proc changes the owner for the current database, so you need t
o USE the database you
want to change owner for first. See Books Online for details on how to use t
his procedure.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jagminder Chugh" <JagminderChugh@.discussions.microsoft.com> wrote in messag
e
news:336DF028-34FB-431C-8739-C35C9FBF7460@.microsoft.com...[vbcol=seagreen]
> when i try that it says,
> Cannot change the owner of the master database.
> "Tibor Karaszi" wrote:
>|||hey tibor, your site is down..|||Thanks. It was down for a while, but I can reach it now...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mb" <mb@.discussions.microsoft.com> wrote in message
news:CE44A7CB-CD22-41D7-991D-91817BE5D28F@.microsoft.com...
> hey tibor, your site is down..
>|||Usually that happens when you restore databases from different servers.
Anyway, try running sp_change_users_login. You can find it in the BOL.
--
Lionel Chacon
"Jagminder Chugh" wrote:

> Hi
> In one of the databases, dbo users under Users option does not have the
> login name.Is there any way to assign a login name "sa" to dbo.
> Thanks and Regards
> Jagminder|||sp_change_users_login doesn't work for the owner of the database. For that y
ou need to use
sp_changedbowner.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Lionel Chacon" <LionelChacon@.discussions.microsoft.com> wrote in message
news:5C767497-923B-4041-9A25-787C6D5A4801@.microsoft.com...[vbcol=seagreen]
> Usually that happens when you restore databases from different servers.
> Anyway, try running sp_change_users_login. You can find it in the BOL.
> --
> Lionel Chacon
>
> "Jagminder Chugh" wrote:
>

dbo > login name, it's not sa

I have a few databases on SQL2000 SP4 that are NOT owned by sa, and this
bothers me as I am trying to resolve many security issues. I've used
SP_Changedbowner and the database properties now show the owner as sa, but
when I drill into the user list under the database, the columns displayed
(Name, Login Name, Database Access) show the Name as dbo, but the Login Name
is still NOT sa. <puzzling> Does someone out there have an answer to this
for me? Can you tell me how to reset the DBO to sa, like the other 50
databases on this server?
Thank You!!!
Ok, naivigate to Users (under specific database) and click refresh
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:uKHH1xlDHHA.3396@.TK2MSFTNGP02.phx.gbl...
>I have a few databases on SQL2000 SP4 that are NOT owned by sa, and this
>bothers me as I am trying to resolve many security issues. I've used
>SP_Changedbowner and the database properties now show the owner as sa, but
>when I drill into the user list under the database, the columns displayed
>(Name, Login Name, Database Access) show the Name as dbo, but the Login
>Name is still NOT sa. <puzzling> Does someone out there have an answer to
>this for me? Can you tell me how to reset the DBO to sa, like the other
>50 databases on this server?
> Thank You!!!
>
|||Since you used TSQL code to change the owner, can you try looking at the
owner name using TSQL?
This code will give you the name of all your databases, and login names of
the database owners:
select name, suser_sname(sid)
from master..sysdatabases
If the code shows you the correct owner name, you are good to go.
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:uKHH1xlDHHA.3396@.TK2MSFTNGP02.phx.gbl...
>I have a few databases on SQL2000 SP4 that are NOT owned by sa, and this
>bothers me as I am trying to resolve many security issues. I've used
>SP_Changedbowner and the database properties now show the owner as sa, but
>when I drill into the user list under the database, the columns displayed
>(Name, Login Name, Database Access) show the Name as dbo, but the Login
>Name is still NOT sa. <puzzling> Does someone out there have an answer to
>this for me? Can you tell me how to reset the DBO to sa, like the other
>50 databases on this server?
> Thank You!!!
>
|||Thank you, I did find that refreshing EM displayed the current owner, but
it's also nice to know the TSQL command for this... :-)
==================
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:OkLR45zDHHA.1220@.TK2MSFTNGP04.phx.gbl...
> Since you used TSQL code to change the owner, can you try looking at the
> owner name using TSQL?
> This code will give you the name of all your databases, and login names of
> the database owners:
> select name, suser_sname(sid)
> from master..sysdatabases
> If the code shows you the correct owner name, you are good to go.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> http://sqlblog.com
>
> "WANNABE" <breichenbach AT istate DOT com> wrote in message
> news:uKHH1xlDHHA.3396@.TK2MSFTNGP02.phx.gbl...
>

dbo > login name, it's not sa

I have a few databases on SQL2000 SP4 that are NOT owned by sa, and this
bothers me as I am trying to resolve many security issues. I've used
SP_Changedbowner and the database properties now show the owner as sa, but
when I drill into the user list under the database, the columns displayed
(Name, Login Name, Database Access) show the Name as dbo, but the Login Name
is still NOT sa. <puzzling> Does someone out there have an answer to this
for me? Can you tell me how to reset the DBO to sa, like the other 50
databases on this server'
Thank You!!!Ok, naivigate to Users (under specific database) and click refresh
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:uKHH1xlDHHA.3396@.TK2MSFTNGP02.phx.gbl...
>I have a few databases on SQL2000 SP4 that are NOT owned by sa, and this
>bothers me as I am trying to resolve many security issues. I've used
>SP_Changedbowner and the database properties now show the owner as sa, but
>when I drill into the user list under the database, the columns displayed
>(Name, Login Name, Database Access) show the Name as dbo, but the Login
>Name is still NOT sa. <puzzling> Does someone out there have an answer to
>this for me? Can you tell me how to reset the DBO to sa, like the other
>50 databases on this server'
> Thank You!!!
>|||Since you used TSQL code to change the owner, can you try looking at the
owner name using TSQL?
This code will give you the name of all your databases, and login names of
the database owners:
select name, suser_sname(sid)
from master..sysdatabases
If the code shows you the correct owner name, you are good to go.
--
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:uKHH1xlDHHA.3396@.TK2MSFTNGP02.phx.gbl...
>I have a few databases on SQL2000 SP4 that are NOT owned by sa, and this
>bothers me as I am trying to resolve many security issues. I've used
>SP_Changedbowner and the database properties now show the owner as sa, but
>when I drill into the user list under the database, the columns displayed
>(Name, Login Name, Database Access) show the Name as dbo, but the Login
>Name is still NOT sa. <puzzling> Does someone out there have an answer to
>this for me? Can you tell me how to reset the DBO to sa, like the other
>50 databases on this server'
> Thank You!!!
>|||Thank you, I did find that refreshing EM displayed the current owner, but
it's also nice to know the TSQL command for this... :-)
=================="Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:OkLR45zDHHA.1220@.TK2MSFTNGP04.phx.gbl...
> Since you used TSQL code to change the owner, can you try looking at the
> owner name using TSQL?
> This code will give you the name of all your databases, and login names of
> the database owners:
> select name, suser_sname(sid)
> from master..sysdatabases
> If the code shows you the correct owner name, you are good to go.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> http://sqlblog.com
>
> "WANNABE" <breichenbach AT istate DOT com> wrote in message
> news:uKHH1xlDHHA.3396@.TK2MSFTNGP02.phx.gbl...
>>I have a few databases on SQL2000 SP4 that are NOT owned by sa, and this
>>bothers me as I am trying to resolve many security issues. I've used
>>SP_Changedbowner and the database properties now show the owner as sa, but
>>when I drill into the user list under the database, the columns displayed
>>(Name, Login Name, Database Access) show the Name as dbo, but the Login
>>Name is still NOT sa. <puzzling> Does someone out there have an answer
>>to this for me? Can you tell me how to reset the DBO to sa, like the
>>other 50 databases on this server'
>> Thank You!!!
>

dbo > login name, it's not sa

I have a few databases on SQL2000 SP4 that are NOT owned by sa, and this
bothers me as I am trying to resolve many security issues. I've used
SP_Changedbowner and the database properties now show the owner as sa, but
when I drill into the user list under the database, the columns displayed
(Name, Login Name, Database Access) show the Name as dbo, but the Login Name
is still NOT sa. <puzzling> Does someone out there have an answer to this
for me? Can you tell me how to reset the DBO to sa, like the other 50
databases on this server'
Thank You!!!Ok, naivigate to Users (under specific database) and click refresh
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:uKHH1xlDHHA.3396@.TK2MSFTNGP02.phx.gbl...
>I have a few databases on SQL2000 SP4 that are NOT owned by sa, and this
>bothers me as I am trying to resolve many security issues. I've used
>SP_Changedbowner and the database properties now show the owner as sa, but
>when I drill into the user list under the database, the columns displayed
>(Name, Login Name, Database Access) show the Name as dbo, but the Login
>Name is still NOT sa. <puzzling> Does someone out there have an answer to
>this for me? Can you tell me how to reset the DBO to sa, like the other
>50 databases on this server'
> Thank You!!!
>|||Since you used TSQL code to change the owner, can you try looking at the
owner name using TSQL?
This code will give you the name of all your databases, and login names of
the database owners:
select name, suser_sname(sid)
from master..sysdatabases
If the code shows you the correct owner name, you are good to go.
--
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:uKHH1xlDHHA.3396@.TK2MSFTNGP02.phx.gbl...
>I have a few databases on SQL2000 SP4 that are NOT owned by sa, and this
>bothers me as I am trying to resolve many security issues. I've used
>SP_Changedbowner and the database properties now show the owner as sa, but
>when I drill into the user list under the database, the columns displayed
>(Name, Login Name, Database Access) show the Name as dbo, but the Login
>Name is still NOT sa. <puzzling> Does someone out there have an answer to
>this for me? Can you tell me how to reset the DBO to sa, like the other
>50 databases on this server'
> Thank You!!!
>|||Thank you, I did find that refreshing EM displayed the current owner, but
it's also nice to know the TSQL command for this... :-)
==================
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:OkLR45zDHHA.1220@.TK2MSFTNGP04.phx.gbl...
> Since you used TSQL code to change the owner, can you try looking at the
> owner name using TSQL?
> This code will give you the name of all your databases, and login names of
> the database owners:
> select name, suser_sname(sid)
> from master..sysdatabases
> If the code shows you the correct owner name, you are good to go.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> http://sqlblog.com
>
> "WANNABE" <breichenbach AT istate DOT com> wrote in message
> news:uKHH1xlDHHA.3396@.TK2MSFTNGP02.phx.gbl...
>