【发布时间】:2015-02-10 20:11:10
【问题描述】:
我有三个不同数据的表,我需要插入一个 TEMP 表并在 StoredProcedure 中返回该表。
我试过了:
-- To get last 10 Days Letters count
SELECT col1,col2,1 AS Type, LettersCount
INTO #temp FROM tblData
-- To get last 4 weeks Letters count
SELECT col1,col2,2 AS Type, LettersCount
INTO #temp FROM tblData
-- To get month wise Letters count
SELECT col1,col2,3 AS Type, LettersCount
INTO #temp FROM tblData
将错误显示为
Msg 2714, Level 16, State 1, Line 16
There is already an object named '#temp ' in the database.
Msg 102, Level 15, State 1, Line 24
Incorrect syntax near 'T'.
Msg 2714, Level 16, State 1, Line 32
There is already an object named '#temp ' in the database.
【问题讨论】:
标签: sql sql-server database sql-server-2008 select