Change the table owner to dbo. When other users log on to the remote database, the new table owner is not dbo. To change the table owner to dbo, use the following statement to operate .www.2cto.com for batch modification: program code EXECsp_MSforeachtableexecsp_changeobjectowner ?, Dbo single modification: program code execsp_changeobjecto
Change the table owner to dbo. When other users log on to the remote database, the new table owner is not dbo. You can change the table owner to dbo using the following statements. www.2cto.com batch modification: program code EXEC sp_MSforeachtable exec sp_changeobjectowner ?, Dbo single modification: program code exec sp_changeobjecto
Change the table owner to dbo.
When other users log on to the remote database, the owner of the newly created table is not dbo. to change it to dbo, use the following words for Operation: www.2cto.com
Batch modification:
Program code EXEC sp_MSforeachtable 'exec sp_changeobjectowner ''? '', ''Dbo '''
Single modification:
Program code exec sp_changeobjectowner 'name of the table to be changed ', 'dbo'
Manual modification:
Click "table"> "design"> "properties"> "change the owner. This method is applicable when the number of tables is small.
Www.2cto.com
-- If a database (table and stored procedure) has multiple user names, you can use the following statement to change all of them to dbo:
Select 'SP _ changeobjectowner ''' + User_Name (Uid) + '. '+ name + ''', ''dbo'' From sysobjects Where Uid Not in (User_ID ('dbo') And Type In ('U', 'P ')
-- Then copy the query statements and change the objects in the table and stored procedure when running them directly. However, SQL SERVER must exit and then go in, to see the changed result.