I am getting an error formatting SQL with an Insert using Execute stored procedure, any ideas?
PaulBP14
Posts: 3 New member
in SQL Prompt
The following code causes "Error laying out sql" when formatting SQL with SQL Prompt:
Insert
Into tmpRptInvoiceHistory (
BookingNo,
ReportDate )
Exec (@SQL) At WSLSource;
Insert
Into tmpRptInvoiceHistory (
BookingNo,
ReportDate )
Exec (@SQL) At WSLSource;
Tagged:
Answers
GO
CREATE TABLE tmpRptInvoiceHistory
(
BookingNo INT,
ReportDate DATETIME
);
GO
DECLARE @sql VARCHAR(MAX);
SELECT @sql = 'Select 1,''1 Jan 2008''';
INSERT INTO tmpRptInvoiceHistory(BookingNo, ReportDate) EXEC(@sql); --At WSLSource;
This does appear to be a bug which I've logged as SP-6583.
Thanks for pointing this out! I'll post here once we have an update.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?