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

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
posted @ 2007-05-06 12:42  shiningrise  阅读(975)  评论(2编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css