Search code examples
sqlsql-serversql-server-2012

there a way to drop 'sysmessages' table from one database?


Unfortunately, I created a table called 'sysmessages' in SQL Server 2008. When I restored the DB to SQL Server 2012, I realized that I have two Tables called 'sysmessages'.

I don't want to change my table name because it has been used in the code.

Can I remove only from specific database system table?


Solution

    1. it is not a table, but a view
    2. of course you cannot remove it, but you don't need to. It is in a different schema. You will not address it like select * from sys.sysmessages, you will address it like select * from dbo.sysmessages
    3. "i don't want to change my table name because it is used in the code" - you can/should change the code as well :)

    edit - no. 2. is not applicable in SQL 2012, however it is tested and working in SQL 2008R2