Monday, March 26, 2012
How to change owner?
Thanks!from Books Online:
Syntax
sp_changeobjectowner [ @.objname = ] 'object' , [ @.newowner = ] 'owner'
Example
EXEC sp_changeobjectowner 'authors', 'Corporate\GeorgeW'|||This was really fast! :)
Thank you very much!sql
How to change owner of stored procedure in MS SQL 2000?
<ikbea@.discussions.microsoft.com> wrote:
>For MS SQL 2000, how to change owner of stored procedure? Many thanks
Answered in .programming by someone else. Please do not multi-post.
Roy Harvey
Beacon Falls, CT|||Have a look at sp_changeobjectowner
Andrew J. Kelly SQL MVP
"ikbea" <ikbea@.discussions.microsoft.com> wrote in message
news:1A9E516A-7522-4C73-94B9-2E2160605EFB@.microsoft.com...
> For MS SQL 2000, how to change owner of stored procedure? Many thanks
How to change owner of stored procedure in MS SQL 2000?
<ikbea@.discussions.microsoft.com> wrote:
>For MS SQL 2000, how to change owner of stored procedure? Many thanks
Answered in .programming by someone else. Please do not multi-post.
Roy Harvey
Beacon Falls, CT|||Have a look at sp_changeobjectowner
--
Andrew J. Kelly SQL MVP
"ikbea" <ikbea@.discussions.microsoft.com> wrote in message
news:1A9E516A-7522-4C73-94B9-2E2160605EFB@.microsoft.com...
> For MS SQL 2000, how to change owner of stored procedure? Many thanks
How to change owner of stored procedure in MS SQL 2000?
On Thu, 26 Jul 2007 08:16:03 -0700, ikbea
<ikbea@.discussions.microsoft.com> wrote:
>For MS SQL 2000, how to change owner of stored procedure? Many thanks
Answered in .programming by someone else. Please do not multi-post.
Roy Harvey
Beacon Falls, CT
|||Have a look at sp_changeobjectowner
Andrew J. Kelly SQL MVP
"ikbea" <ikbea@.discussions.microsoft.com> wrote in message
news:1A9E516A-7522-4C73-94B9-2E2160605EFB@.microsoft.com...
> For MS SQL 2000, how to change owner of stored procedure? Many thanks
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!
how to change owner for many tables
i have a whole bunch of tables with me as owner - i want to make dbo owner.
how?
i just can't find an appropriate mouse click in enterprise manager, and i don't really want the 40 command lines to do it manually.
thanks for ideas, izyNo bulk way that I know of in Enterprise Mangler.
So we are reduced to being deviant... Er, devious. We use a script to write a script!SELECT 'EXECUTE sp_changeobjectowner ''[' + su.name + '].['
+ so.name + ']'', ''dbo'''
FROM dbo.sysusers AS su
JOIN dbo.sysobjects AS so
ON (so.uid = su.uid)
WHERE 'izy' = su.name
ORDER BY so.nameThis will create a script as its output that you can copy into query analyzer, exectute, and go merrily on your way.
-PatP|||big gulp!
Pat - thanks: that's really scary but i'll give it a thrash and see what falls out of the tree.
izy|||purrrrfect.
thanks a lot, izy|||See, it helps to have deviant... Er, devious friends!
Thinking "outside the box" is a bit difficult at first, but the dividends can be huge. I keep wondering "What box?" whenever I hear that phrase though!
-PatP|||See, it helps to have deviant... Er, devious friends!
Thinking "outside the box" is a bit difficult at first, but the dividends can be huge. I keep wondering "What box?" whenever I hear that phrase though!
-PatP
Boy that is such an opening...nah, better not...|||Boy that is such an opening...nah, better not...Allright! Where have you put the real Brett ?
-PatPsql
How to change owner for all tables in a database.
it?(alexkuzn@.gmail.com) writes:
Quote:
Originally Posted by
I am trying to change owner of all tables in a database. How can I do
it?
DECLARE @.tbl sysname
DECLARE tblcur INSENSITIVE CURSOR FOR
SELECT name FROM sysobjects
WHERE xtype = 'U' AND uid = user_id('oldowner')
OPEN tblcur
WHILE 1 = 1
BEGIN
FETCH tblcur INTO @.tbl
IF @.@.fetch_status <0
BREAK
EXEC sp_changeobjectonwer @.tbl, 'oldowner', 'newowner'
END
DEALLOCATE tblcur
The above is untested, and you may have to look up details in Books Online.
Furthermore, I'm assuming SQL 2000. On SQL 2005, the preferred solution is
different. In fact, odds are good that on SQL 2005 you would not need to do
this at all, since schema and onwer are separated. All depending on why you
want to change the owner, that is.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
how to change Owner
test.i want to replace this owner with dbo.
i execute the sp_changeobjectowner 'tbluser' ,'dbo'
while i try to this i got the error
Server: Msg 15001, Level 16, State 1, Procedure
sp_changeobjectowner, Line 38
Object 'tblUser' does not exist or is not a valid object for this
operation.
i login as an 'sa' while trying to perform this operation.
Please let me know how do i change the owner.Try,
sp_changeobjectowner 'test.tbluser' ,'dbo'
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"Mustafa" <Mustafa@.discussions.microsoft.com> wrote in message
news:616C728C-4CE0-4F9D-BC3A-947CE7A57388@.microsoft.com...
>i want to change the database owner to dbo.rightnow the owner is
> test.i want to replace this owner with dbo.
> i execute the sp_changeobjectowner 'tbluser' ,'dbo'
> while i try to this i got the error
> Server: Msg 15001, Level 16, State 1, Procedure
> sp_changeobjectowner, Line 38
> Object 'tblUser' does not exist or is not a valid object for this
> operation.
>
> i login as an 'sa' while trying to perform this operation.
> Please let me know how do i change the owner.
Friday, March 23, 2012
how to change dts owner name
does anyone know how to change a dts packeage's owner name
on sql 2000?
we have individuals that creates dts packages on
production servers, and we would like to change the dts
owner name from the individual accounts into server's own
account name.
many thanks!
JJ
sp_changeobjectowner
I've never had to change a dts owner, but this is where I would look first.
John
"JJ Wang" wrote:
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ
>
|||Check out http://www.sqldts.com/default.aspx?212.
Hope this helps.
Dan Guzman
SQL Server MVP
"JJ Wang" <anonymous@.discussions.microsoft.com> wrote in message
news:03d001c4a74b$4ce490d0$a501280a@.phx.gbl...
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ
|||sp_changeobjectowner is intended for SQL Server database objects and can't
be used for DTS packages.
Hope this helps.
Dan Guzman
SQL Server MVP
"John Cappelletti" <JohnCappelletti@.discussions.microsoft.com> wrote in
message news:7D4B53C1-5AAD-42F5-A8FE-C1DB9DB37508@.microsoft.com...[vbcol=seagreen]
> sp_changeobjectowner
> I've never had to change a dts owner, but this is where I would look
> first.
> John
>
> "JJ Wang" wrote:
|||I use:
use msdb
go
sp_reassign_dtspackageowner [@.name =] 'name',
[@.id =] 'id',
[@.newloginname =] 'newloginname'
--to find dts package id :
use msdb
go
select * from sysdtspackages
go
"JJ Wang" wrote:
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ
>
how to change dts owner name
does anyone know how to change a dts packeage's owner name
on sql 2000?
we have individuals that creates dts packages on
production servers, and we would like to change the dts
owner name from the individual accounts into server's own
account name.
many thanks!
JJsp_changeobjectowner
I've never had to change a dts owner, but this is where I would look first.
John
"JJ Wang" wrote:
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ
>|||Check out http://www.sqldts.com/default.aspx?212.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"JJ Wang" <anonymous@.discussions.microsoft.com> wrote in message
news:03d001c4a74b$4ce490d0$a501280a@.phx.gbl...
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ|||sp_changeobjectowner is intended for SQL Server database objects and can't
be used for DTS packages.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"John Cappelletti" <JohnCappelletti@.discussions.microsoft.com> wrote in
message news:7D4B53C1-5AAD-42F5-A8FE-C1DB9DB37508@.microsoft.com...
> sp_changeobjectowner
> I've never had to change a dts owner, but this is where I would look
> first.
> John
>
> "JJ Wang" wrote:
>> hi,
>> does anyone know how to change a dts packeage's owner name
>> on sql 2000?
>> we have individuals that creates dts packages on
>> production servers, and we would like to change the dts
>> owner name from the individual accounts into server's own
>> account name.
>> many thanks!
>> JJ|||I use:
use msdb
go
sp_reassign_dtspackageowner [@.name =] 'name',
[@.id =] 'id',
[@.newloginname =] 'newloginname'
--to find dts package id :
use msdb
go
select * from sysdtspackages
go
"JJ Wang" wrote:
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ
>|||wow, thanks to you all for the quick response, tons of
good tips here. you solved my problem!!
thank you so much!!!!
JJ
>--Original Message--
>hi,
>does anyone know how to change a dts packeage's owner
name
>on sql 2000?
>we have individuals that creates dts packages on
>production servers, and we would like to change the dts
>owner name from the individual accounts into server's own
>account name.
>many thanks!
>JJ
>.
>
How to change dts owner
If it is possible, How to change the owner.
thanks.>--Original Message--
>It is possible to change dts owner ?
>If it is possible, How to change the owner.
>thanks.
>.
>
Try this:
http://www.sqldts.com/default.aspx?6,105,212,0,0
Regards,
Thomas
http://wwwl.sqlscripter.com|||Try this:
sp_reassign_dtspackageowner [@.name =] 'name',
[@.id =] 'id',
[@.newloginname =] 'newloginname'
Both the @.name and @.id parameters are required as a package name is not
guaranteed to be unique.
Zvi
"kresna rudy kurniawan" <kresnark@.yahoo.com> wrote in message
news:25e5f01c38e11$886a4540$a601280a@.phx.gbl...
> It is possible to change dts owner ?
> If it is possible, How to change the owner.
> thanks.|||Hello
> It is possible to change dts owner ?
> If it is possible, How to change the owner.
Update msdb..sysdtspackages set owner = 'newowner' where versionid ='...'
Serge Shakhovsql
Wednesday, March 21, 2012
how to change db owner in SQL Server 2000
we have created a new database in SQL Server 2000 and need
to change the database owner of the database to another
user.
Can someone help?
Thanks for reply.
Bodobodo
Please refer to BOL for sp_changedbowner.
> Hi,
> we have created a new database in SQL Server 2000 and need
> to change the database owner of the database to another
> user.
> Can someone help?
> Thanks for reply.
> Bodo|||Hi,
is it also possible to change dbo in the Enterprise
Manager, without having to go into SQL programming?
Thanks for reply.
Bodo
>--Original Message--
>bodo
>Please refer to BOL for sp_changedbowner.
>
>> Hi,
>> we have created a new database in SQL Server 2000 and
need
>> to change the database owner of the database to another
>> user.
>> Can someone help?
>> Thanks for reply.
>> Bodo
>
>.
>|||AFAIK, there is no GUI method to change the database owner. Howerver,
the T-SQL script to accomplish the task is fairly simple:
USE MyDatabase
EXEC sp_changedbowner 'MyDatabaseOwner'
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
--
"bodo" <bodobecker@.hotmail.com> wrote in message
news:00b601c36ff8$e7706060$a601280a@.phx.gbl...
> Hi,
> is it also possible to change dbo in the Enterprise
> Manager, without having to go into SQL programming?
> Thanks for reply.
> Bodo
> >--Original Message--
> >bodo
> >Please refer to BOL for sp_changedbowner.
> >
> >
> >
> >> Hi,
> >>
> >> we have created a new database in SQL Server 2000 and
> need
> >> to change the database owner of the database to another
> >> user.
> >>
> >> Can someone help?
> >>
> >> Thanks for reply.
> >>
> >> Bodo
> >
> >
> >.
> >|||Hi Dan,
sorry for asking you for help again - you know I am new to
SQL Server but I want to learn it.
Can you tell me where to find the interface where I can
type in the code you gave me?
Thanks for reply.
Bodo
>--Original Message--
>AFAIK, there is no GUI method to change the database
owner. Howerver,
>the T-SQL script to accomplish the task is fairly simple:
> USE MyDatabase
> EXEC sp_changedbowner 'MyDatabaseOwner'
> 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
>--
>"bodo" <bodobecker@.hotmail.com> wrote in message
>news:00b601c36ff8$e7706060$a601280a@.phx.gbl...
>> Hi,
>> is it also possible to change dbo in the Enterprise
>> Manager, without having to go into SQL programming?
>> Thanks for reply.
>> Bodo
>> >--Original Message--
>> >bodo
>> >Please refer to BOL for sp_changedbowner.
>> >
>> >
>> >
>> >> Hi,
>> >>
>> >> we have created a new database in SQL Server 2000 and
>> need
>> >> to change the database owner of the database to
another
>> >> user.
>> >>
>> >> Can someone help?
>> >>
>> >> Thanks for reply.
>> >>
>> >> Bodo
>> >
>> >
>> >.
>> >
>
>.
>
How to change db owner for SQL Server 2000 database
How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowner?
Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?select * from sysobjects where xtype='u'
The above command displays user tables. Get each user table name from sysobjects by using cursor or while loop pass the same as input parameter ot the sp_changedbowner
Try ....|||or from enterprise manager,right click on users and from opened users adjust ur adjustments
good luck|||
Quote:
Originally Posted by papayaya
Our programmer has left the company and the tables and views were created with his credential as owner.
How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowner?
Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?
hi dude have a look at this link http://support.microsoft.com/kb/275312|||use [currentdatabase]
go
sp_changedbowner 'yourusername', 'true'
go
This will change the owner of the current database to whatever username you want ( you could put sa in there ) and then remap any alias as well (that's the true).
// John Stone
Quote:
Originally Posted by papayaya
Our programmer has left the company and the tables and views were created with his credential as owner.
How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowner?
Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?
1/ Right Click on the Database node
2/Click Properties
3/Select Files
4/There would be a Owner Text Box, change the new Owner Name or browse and select the new Owner.
Shrimant Patel
&
Harith Patel
How to change database owner from SQL 6.5?
database owner to dbo .i wanna change all the object owner to dbo
"acd" <acd@.msn.com> glsD:u$kU9FVfGHA.2456@.TK2MSFTNGP04.phx.gbl...
> i'm performing sql server migration from 6.5 to server 2000,so i change
> the database owner to dbo .
>|||DBO cannot be the database owner, as the database owner is a login name, and
dbo is a user name within the database. The login name which owns the
database ALWAYS maps to the user name dbo, so there is no way to change the
owners name to anything else, and no reason you would ever have to change
the name TO dbo.
For you second question, SQL 6.5 does not provide the option to change owner
names. It is possible to directly update the system tables to change object
ownership, but it is not supported and not recommended unless you have a LOT
of experience working with the system metadata. The support approach is to
drop the objects and then recreate them with the desired owner.
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"acd" <acd@.msn.com> wrote in message
news:em6jZKVfGHA.1264@.TK2MSFTNGP05.phx.gbl...
>i wanna change all the object owner to dbo
> "acd" <acd@.msn.com>
> glsD:u$kU9FVfGHA.2456@.TK2MSFTNGP04.phx.gbl...
>|||thanks for your reply...
i having a problem for testing database mirgration..
i facing the problem was..when i restore the the database to another sql
server 6.5 and performed database upgrade to 7.0. Since the object own by
different users..so some of the table can not move to 7.0
do u have any idea to help me that problem?
"Kalen Delaney" <replies@.public_newsgroups.com> glsD:%23Q%23iujVfGHA.4276@.TK2MSFTN
GP03.phx.gbl...
> DBO cannot be the database owner, as the database owner is a login name,
> and dbo is a user name within the database. The login name which owns the
> database ALWAYS maps to the user name dbo, so there is no way to change
> the owners name to anything else, and no reason you would ever have to
> change the name TO dbo.
> For you second question, SQL 6.5 does not provide the option to change
> owner names. It is possible to directly update the system tables to change
> object ownership, but it is not supported and not recommended unless you
> have a LOT of experience working with the system metadata. The support
> approach is to drop the objects and then recreate them with the desired
> owner.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.solidqualitylearning.com
>
> "acd" <acd@.msn.com> wrote in message
> news:em6jZKVfGHA.1264@.TK2MSFTNGP05.phx.gbl...
>
How to change database owner from SQL 6.5?
database owner to dbo .i wanna change all the object owner to dbo
"acd" <acd@.msn.com> ¼¶¼g©ó¶l¥ó·s»D:u$kU9FVfGHA.2456@.TK2MSFTNGP04.phx.gbl...
> i'm performing sql server migration from 6.5 to server 2000,so i change
> the database owner to dbo .
>|||DBO cannot be the database owner, as the database owner is a login name, and
dbo is a user name within the database. The login name which owns the
database ALWAYS maps to the user name dbo, so there is no way to change the
owners name to anything else, and no reason you would ever have to change
the name TO dbo.
For you second question, SQL 6.5 does not provide the option to change owner
names. It is possible to directly update the system tables to change object
ownership, but it is not supported and not recommended unless you have a LOT
of experience working with the system metadata. The support approach is to
drop the objects and then recreate them with the desired owner.
--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"acd" <acd@.msn.com> wrote in message
news:em6jZKVfGHA.1264@.TK2MSFTNGP05.phx.gbl...
>i wanna change all the object owner to dbo
> "acd" <acd@.msn.com>
> ¼¶¼g©ó¶l¥ó·s»D:u$kU9FVfGHA.2456@.TK2MSFTNGP04.phx.gbl...
>> i'm performing sql server migration from 6.5 to server 2000,so i change
>> the database owner to dbo .
>>
>|||thanks for your reply...
i having a problem for testing database mirgration..
i facing the problem was..when i restore the the database to another sql
server 6.5 and performed database upgrade to 7.0. Since the object own by
different users..so some of the table can not move to 7.0
do u have any idea to help me that problem?
"Kalen Delaney" <replies@.public_newsgroups.com> ¼¶¼g©ó¶l¥ó·s»D:%23Q%23iujVfGHA.4276@.TK2MSFTNGP03.phx.gbl...
> DBO cannot be the database owner, as the database owner is a login name,
> and dbo is a user name within the database. The login name which owns the
> database ALWAYS maps to the user name dbo, so there is no way to change
> the owners name to anything else, and no reason you would ever have to
> change the name TO dbo.
> For you second question, SQL 6.5 does not provide the option to change
> owner names. It is possible to directly update the system tables to change
> object ownership, but it is not supported and not recommended unless you
> have a LOT of experience working with the system metadata. The support
> approach is to drop the objects and then recreate them with the desired
> owner.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.solidqualitylearning.com
>
> "acd" <acd@.msn.com> wrote in message
> news:em6jZKVfGHA.1264@.TK2MSFTNGP05.phx.gbl...
>>i wanna change all the object owner to dbo
>> "acd" <acd@.msn.com> ¼¶¼g©ó¶l¥ó·s»D:u$kU9FVfGHA.2456@.TK2MSFTNGP04.phx.gbl...
>> i'm performing sql server migration from 6.5 to server 2000,so i change
>> the database owner to dbo .
>>
>>
>
Monday, March 19, 2012
How to change a local DTS package's owner or how to open a password protected package.
In our database server (SQL Server 7.0), there are some local DTS packages,
all were password protected, and we don't know the password, the one who
create them has left the company.
And now, we want to modify them, how to do?
Thanks
FrankLocal packages are held in the msdb database table sysdtspackages. By doing a
simple "SELECT * FROM sysdtspackages" you can see the owner for each package.
Whilst you could probably use a simple UPDATE statement to change the owner,
there is an undocumented stored procedure, that appears to be purpose written
for this task, sp_reassign_dtspackageowner :
sp_reassign_dtspackageowner [@.name =] 'name',
[@.id =] 'id',
[@.newloginname =] 'newloginname'
[@.name =] 'name'
The package name.
[@.id =] 'id'
This is the uniqueidentifier for the package. A name may not necessarily be
unique.
[@.newloginname =] 'newloginname'
The new Owner name. SQL Server login example 'sa', NT Integrated example
'Domain\Username'
If you look at sp_reassign_dtspackageowner you'll notice that it not only
updates the owner text field, but it also updates the owner_sid field.
"Frank" wrote:
> Hi,
> In our database server (SQL Server 7.0), there are some local DTS packages,
> all were password protected, and we don't know the password, the one who
> create them has left the company.
> And now, we want to modify them, how to do?
> Thanks
> Frank
>
>