--1
Create Table #TMP1(tID int);
Insert Into #TMP1(tID) Exec GetID 'TrayList','TrayID';
drop table #TMP1
go
GetID 'TrayList','TypeID'go--2
GetID 'TrayList','TypeID'
go
Create Table #TMP1(tID int);
Insert Into #TMP1(tID) Exec GetID 'TrayList','TrayID';
drop table #TMP1加一个GO 就没问题了
Create Table #TMP1(tID int);
Insert Into #TMP1(tID) Exec GetID 'TrayList','TrayID';
drop table #TMP1
go
GetID 'TrayList','TypeID'go--2
GetID 'TrayList','TypeID'
go
Create Table #TMP1(tID int);
Insert Into #TMP1(tID) Exec GetID 'TrayList','TrayID';
drop table #TMP1加一个GO 就没问题了
用信号通知 Microsoft® SQL Server™ 实用工具一批 Transact-SQL 语句的结束。如果不加GO的话信创建的#TMP1 和 存储过程里面的 #TMP1 会冲突
在存储过程里面最后有GO,所以先执行存储过程再执行语句 没问题,反过来就会报错