How can we help you today? How can we help you today?

I am getting an error formatting SQL with an Insert using Execute stored procedure, any ideas?

The following code causes "Error laying out sql" when formatting SQL with SQL Prompt:

Insert
Into tmpRptInvoiceHistory (
BookingNo,
ReportDate )
Exec (@SQL) At WSLSource;
PaulBP14
0

Comments

5 comments

  • PaulBP14
    P.S. I have version 8.0.7.1917 and I think it was OK in the previous version but not 100% sure.
    PaulBP14
    0
  • Grant
    The syntax seems correct. Let me check with the team.
    Grant
    0
  • Phil_Fact0r
    I get the formatter to work happily if I comment out the '--At WSLSource;' so I reckon the bug is there. It isn't your source which seems fine. I have put an entry in sys.servers for WSLSource to test this.
    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;
    Phil_Fact0r
    0
  • PaulBP14
    Thanks Phil, so is this a bug in SQL Prompt?
    PaulBP14
    0
  • Jessica R
    Hi @PaulBP14,

    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 R
    0

Add comment

Please sign in to leave a comment.