📜  sql server 检查表是否存在 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:04.804000             🧑  作者: Mango

代码示例2
IF EXISTS 
  (SELECT object_id FROM sys.tables
  WHERE name = 'Artists'
  AND SCHEMA_NAME(schema_id) = 'dbo')
  PRINT 'The table exists'
ELSE 
  PRINT 'The table does not exist';