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!

Owner name has stopped views from working 1

Status
Not open for further replies.

pwills

Technical User
Sep 14, 2002
54
0
0
GB
Scenario:
1. I am transferring a db to a new server (using DTS Export).
2. On source_db, the tables are all in the form paddy.Customer. After I do the export they exist on destn_db as dbo.Customer.
3. When I try to export the views I get an error because the views refer to paddy.Customer which of course doesn't exist.
4. The db does not need multiple or otherwise complex security levels.

Questions:
1. Generally, should my tables be owned by paddy or dbo?

2. Is there a "change owner" function which will bulk change all my tables, subject to the above answer?

3. Is there a way to not specify the owner prefix in views, but rather specify the default owner?

4. Finally, is there a flag in DTS Export which exports the tables with the right owner prefixes?
 
pwills,
1) I am of the opinion that everything should be owned by dbo. It makes moving objects easier as you have found, and it makes permissions assignments much simpler because you don't have to worry about ownership chains.

2) use sp_changeobjectowner

3) You could script out the views and change all the instances of paddy to dbo. SQL 2000, you can do this from either enterprise manager or Query Analyzer. From EM, right-click the db, choose all tasks, Generate Scripts. Click the Show All button, then click the views option. Click ok and a location to save to. Then open the script and make the changes.

4)I don't believe there is a flag that can change the owner during the export.
 
I recently provided a cursor that would allow you to change ownership of all objects. Try this link:

thread183-394831

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top