Multiple OUTPUT statements not supported by SQL Prompt 6.1
chrisw13
Posts: 6 Bronze 2
SQL 2008 SP3+ and above (and probably below) supports multiple OUTPUT statements, as long as the first one is OUTPUT INTO and the second is OUTPUT...
These statements are nice to allow OUTPUT INTO a table variable/temp table for further operations, and to OUTPUT to return a result set to the user (SSMS or data layer).
The following TSQL is valid and executes, but SQL Prompt 6.1.0.72 will not format throws the message "SQL Prompt was unable to complete this operation. Problem areas have been highlighted."
SELECT *
INTO #Tbl
FROM ( VALUES ( 0) ) AS tbl (fld)
--Deletes from #Tbl
--Returns #Tbl as a ResultSet
--Inserts back it into #Tbl
DELETE FROM #Tbl
OUTPUT DELETED.*
INTO #Tbl
OUTPUT DELETED.*
These statements are nice to allow OUTPUT INTO a table variable/temp table for further operations, and to OUTPUT to return a result set to the user (SSMS or data layer).
The following TSQL is valid and executes, but SQL Prompt 6.1.0.72 will not format throws the message "SQL Prompt was unable to complete this operation. Problem areas have been highlighted."
SELECT *
INTO #Tbl
FROM ( VALUES ( 0) ) AS tbl (fld)
--Deletes from #Tbl
--Returns #Tbl as a ResultSet
--Inserts back it into #Tbl
DELETE FROM #Tbl
OUTPUT DELETED.*
INTO #Tbl
OUTPUT DELETED.*
Comments
I was able to reproduce the behavior and have logged this issue in our bug tracking system under the internal reference number of SP-4910.
Unfortunately I am unable to provide a timeline for when this may be fixed.
Product Support
Red Gate Software