ron ron -4 years ago 178
SQL Question

How to remove or alter the dbo prefix from SQL Server 2012 tables?

Someone already had asked this question here but didn't get an answer for that question .

How can I change a table in SQL Server 2012 that starts with a dbo prefix to one without ?

Answer Source

Here is the answer (alter !!!) , for anyone that might need it someday :

IF (NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'MyDbo')) 
BEGIN
    EXEC ('CREATE SCHEMA [MyDbo] AUTHORIZATION [dbo]')
END

ALTER SCHEMA MyDbo 
    TRANSFER dbo.your_old_table
GO
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download