Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Sarat
Constraint Violating Yak Guru
265 Posts |
Posted - 2004-01-30 : 11:00:01
|
| Hi, I have a database with tables with owner as xyz. I want to change it to dbo. How can I do it all without changing it one by one?Thanks,Sarat.**To be intoxicated is to feel sophisticated, but not be able to say it.** |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-01-30 : 12:31:12
|
| This will write out the commands for you. Just copy the output into another window and execute it. You'll want to verify that it writes out the correct information though.SELECT 'EXEC sp_changeobjectowner ''' + name + ''', ''dbo'''FROM sysobjectsWHERE type = 'U' and name <> 'dtproperties'ORDER BY nameTara |
 |
|
|
Sarat
Constraint Violating Yak Guru
265 Posts |
Posted - 2004-01-30 : 13:16:25
|
| Thank You very much!**To be intoxicated is to feel sophisticated, but not be able to say it.** |
 |
|
|
|
|
|