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 |
|
SamC
White Water Yakist
3467 Posts |
Posted - 2002-07-22 : 18:57:21
|
| Hope this is the right forum for this question...This is a revision of an earlier post with some additional information I gathered.I have one database on my desktop that seems to have tables owned by the dbowner, not dbo. This is an anomaly on my server relative to the configuration of the other databases.These db are served by ASP code. The same owner accesses the data - always. All but one of my databases has the tables owned by dbo. There doesn't seem to be any operational difference.I'm not sure what the goals are here or what direction I should be taking for a web-application database. I'd be interested to hear about what the issues are on table ownership.SamEdited by - SamC on 07/22/2002 20:47:11 |
|
|
smccreadie
Aged Yak Warrior
505 Posts |
Posted - 2002-07-23 : 06:09:29
|
| Generally speaking, it is best to have the objects owned by dbo as it avoids potential permissions hassles. That works well especially in a web environment. You want to avaoid having the same table names with different owners as it causes confusion.There are scripts out there to change ownership if you search for them. |
 |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2002-07-23 : 11:45:59
|
| I did a quick search for scripts using google. Lots of stuff out there for Oracle didn't see anything for SQL.Checked sqlteam.comAny recommended sites to search?SamC |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-07-23 : 11:50:20
|
| How about Books Online? sp_changeobjectowner |
 |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2002-07-23 : 20:07:35
|
| And if you have a lot of tables the change the owner on, do a search for sp_MSForeachtable. Or buy the book (I haven't done this in a long time... Rob, I can't believe you missed your chance...) The Guru's Guide to Transact-SQL by Ken Henderson which has a chapter on undocumented procedures (which the sp_SMforeachtable is one). |
 |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2002-07-23 : 20:12:03
|
| By the way, assiging somebody the db_owner database role is not the same as setting them as the dbo (sp_changedbowner). Anyone issuing CREATE ... statements should use at least 2-part naming and specify dbo. Such as:CREATE TABLE dbo.MyTable... |
 |
|
|
|
|
|