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

kokeuurv  于 11个月前  发布在  其他
关注(0)|答案(2)|浏览(110)

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?

kuhbmx9i

kuhbmx9i1#

  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

zpgglvta

zpgglvta2#

You cant drop system tables,your best bet is to change your code

相关问题