Announcement

Collapse
No announcement yet.

Incorrect Semicolon Handling

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Incorrect Semicolon Handling

    According to the ANSI standard and Microsoft's documentation, a semicolon is a valid line terminator. When I run this code in Navicat Essentials for SQL Server (version 11.2.7):

    Code:
    declare @txtDocumentName varchar(120);
    set @txtDocumentName = 'Master';
    I receive the following messages:

    Code:
    [2016-01-15 16:18:03] [000060] [DBNAME] [SQL Server]
    declare @txtDocumentName     varchar(120)
    
    [2016-01-15 16:18:03] [000060] [DBNAME] [SQL Server]
    set @txtDocumentName = 'Master'
    
    [2016-01-15 16:18:03] [000060] [DBNAME] [SQL Server]
    Error: [FreeTDS][SQL Server]Must declare the scalar variable "@txtDocumentName".
    Is anyone else having this issue? Is this only a problem with the Essentials distribution?

  • #2
    Please add BEGIN before the DECLARE keyword and add END; at the end of the query. Example:

    BEGIN
    declare @txtDocumentName varchar(120);
    set @txtDocumentName = 'Master';
    END;

    Comment

    Working...
    X