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 |
tokue
Starting Member
16 Posts |
Posted - 2012-04-09 : 10:00:28
|
Hi,Can we change a table owner using sql?Second question: What is the meaning of (dbo)? I noticed that all tables in my database have (dbo) as the owner?another question (please forgive me I noticed after converting my 2005 database to 2008 that the new database is almost one third of the old one in size (was 90 mbyte, 36 mbyte after converting it). why did that happen? and is there a way to clean or shrink the old database using a sql statement. |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2012-04-09 : 10:38:17
|
This is from Books On LineThe following example modifies the schema HumanResources by transferring the table Address from schema Person into the schema.USE AdventureWorks;GOALTER SCHEMA HumanResources TRANSFER Person.Address;GOJimEveryday I learn something that somebody else already knew |
 |
|
tokue
Starting Member
16 Posts |
Posted - 2012-04-09 : 11:14:58
|
I don't understand your code jimf. can you explain it please.Thanks to google I succeeded in changing the owner (OLDOWNER) of my table (TB) using this query:exec sp_changeobjectowner 'OLDOWNER.TB', 'dbo'still waiting for answer about shrinking the database! |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|