DECLARE @DbTableFileNameVARCHAR(100) SET@DbTableFileName='tx' IFEXISTS (SELECT1 FROM sysobjects WHERE name =@DbTableFileName AND TYPE ='u') PRINT'EXISTS ' ELSE PRINT'NOT EXISTS '
SQL学习之查询技巧 查询表是否存在的两种方法方法一 判断系统对象是否存在DECLARE @DbTableFileName VARCHAR(100)SET @DbTableFileName = txIF objectproperty(object_id(@DbTableFileName),IsUserTable) IS NOT NULL PRINT EXISTS E