MS SQL How to change Schema

Published on: 16 January 2008 By: Ahsan Khan

Sometimes when we create a table or a stored procedure it is created as
[databasename].[mylastname].[tablename] instead of [databasename].[dbo].[tablename]

Example

EXEC('sp_changeobjectowner @objname = ''mylastname.tablename'', @newowner = dbo')

In this example, mylastname.tablename is the object name. You may replace it with your object.

















underline

View All Articles (Articles Archive)