BnDSites BnDSites - 7 months ago 15
SQL Question

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

unfortunately i create table call 'sysmessages' in SQL Server 2008. when i restore the DB to SQL Server 2012 i realize that i have two Tables call 'sysmessages'.
i don't want to change my table name because it using in the code.

can i remove only from specific database system table?

Answer
  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