Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

explain owners of db

Status
Not open for further replies.

aspnet98

MIS
May 19, 2005
165
0
0
US
I have noticed when developing in ACCESS project and SQL server 2000 that I get mixed owners of table and views i create and i am not sure why? i login the sameway for both cases as a user that is the DB_Owner?

Can someone clearify this process to me so I can stay consistent. i did not notice this until now, but i have to transfer the whole db to another server (i am not allowed to use backup and transfer :( ) and all of my sql references are to different owners.TABLE NAME.

I am really stuck.........
 
NOt sure why that is happening , but when you create an object, you can always specify the owner as part of the SQL.
For example:
Create table mydatabase.dbo.mytablename
(an then the table structure of course)

I would suggest you do this from now on. Also, look in BOL (I'm not at work and am going from memory here) but there is a system stored procedure (Sp_changeOwner?) to changge the owner on objects. Use that to fix the ones you have already created.


Questions about posting. See faq183-874
Click here to help with Hurricane Relief
 
sqlsis,
sp_changeowner is my new favorite SP. I will be using it 1000 times today.....
 
An easy way to do things like this:
Code:
select 'sp_changeowner ' + table_name 
from   information_schema.tables 
where  table_type = 'base table'

copy the results to query analyzer and run them.

If you are already doing something like this then disregard my post.

Regards,
AA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top