现在的位置: 首页 > 综合 > 正文

在SQL Server中安全的创建,使用,和删除一个临时表

2012年06月23日 ⁄ 综合 ⁄ 共 259字 ⁄ 字号 评论关闭
USE AdventureWorks;
GO
CREATE TABLE #temptable (col1 int);
GO
INSERT INTO #temptable
VALUES (10);
GO
SELECT * FROM #temptable;
GO
IF OBJECT_ID(N'tempdb..#temptable', N'U') IS NOT NULL
DROP TABLE #temptable;
GO
--Test the drop.
SELECT * FROM #temptable;

摘自:http://www.webfans.org/blog/read.php?142

抱歉!评论已关闭.