我在我的存储过程中使用临时表#tempTable - 我用它来运行我的ASP.net报告(报告服务)
我正在做类似的事情
例如.码
SELECT * INTO #tempTable FROM Contacts WHERE ContactID < 10
Run Code Online (Sandbox Code Playgroud)
然后我用类似的东西
SELECT o.* FROM #tempTable t INNER JOIN Orders o ON t.ContactID =o.ContactID
Run Code Online (Sandbox Code Playgroud)
将值返回到我的报告,即存储过程的结果
我没有摆脱我的#tempTable
即我不这样做
DROP TABLE #tempTable
Run Code Online (Sandbox Code Playgroud)
我已经读过临时表的范围只适用于存储过程 - 所以做了以上必要的操作 - 如果我不做上面的话我将来会遇到什么问题