临时表方法
IF OBJECT_ID('tempdb..#TempTable') IS NULL
BEGIN
CREATE TABLE #TempTable (
WO_SEQUENCE varchar(50), STATION_NO varchar(50),FEEDER_NO varchar(50), REEL_NO varchar(50), REEL_QTY int
)
select 'NOT EXIST!'
END
ELSE
BEGIN
SELECT 'EXIST!'
END
用户表方法
IF ( SELECT *
FROM sys.tables
WHERE name = N'LZtable' AND schema_id = SCHEMA_ID(N'dbo') )
BEGIN
select 'NOT EXIST!'
END
ELSE
BEGIN
SELECT 'EXIST!'
END