Select * into #tempTable from exec Command shows an error
本问题已经有最佳答案,请猛点这里访问。
我正在执行包含以下代码的字符串
1 2 3 4 5 6 7 | DECLARE @BadgeNo NVARCHAR(MAX); SET @BadgeNo='8107'; SELECT * INTO #Testing EXEC spNotification 'Param1','Param2','Param3','Param4'; EXEC spSqlTmpTblToHtmlTbl 'tempdb..#Testing' |
我只想要HTML格式的结果。所以我执行
1 | SELECT * INTO |
号
命令不能与
你可能想这样做":
1 2 3 4 5 6 7 8 | CREATE TABLE #Testing ( COLUMN1 INT, COLUMN2 INT ) INSERT INTO #Testing EXEC spNotification 'Param1','Param2','Param3','Param4'; |
还要检查如何从[存储过程]中选择*到[临时表]
或者您可以尝试使用OpenQuery:
1 2 3 | SELECT * INTO #Testing FROM OPENQUERY(YOURSERVERNAME, 'Exec spNotification 'Param1','Param2','Param3','Param4'') |
号
试试这个:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | DECLARE @Testing TABLE ( COLUMN1 INT, COLUMN2 INT ) INSERT INTO @Testing (COLUMN1, COLUMN2) EXEC SPNOTIFICATION 'Param1', 'Param2', 'Param3', 'Param4'; |