Syntax error on script with EXECUTE statement

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 13
Joined: Thu 19 May 2011 09:34
Location: The Netherlands

Syntax error on script with EXECUTE statement

Post by vanmeir » Mon 20 Mar 2017 10:46


since the latest update of the SDAC components to version 7.3.15 I get errors on scripts containing EXECUTE statements.

I load text files into a TMSScript component and execute them.
Executing a script like
DECLARE @DBVersion [varchar] (128)
SELECT @DBVersion = [Value] FROM [dbo].[InternalParameter] WHERE [ParamName] = 'DBVersion'

IF @DBVersion = '2.6.170'

EXECUTE sp_rename N'dbo.Tmp_Product', N'Product', 'OBJECT'

SELECT @DBVersion = '2.6.171'

UPDATE [dbo].[InternalParameter] SET [Value] = @DBVersion WHERE [ParamName] = 'DBVersion'
leads to an exception 'Syntax error near TRANSACTION'.

I have tested over one hundred scripts and every script where I use the MS SQL Server EXECUTE statement fails and the exception text always refers to the line just before the EXCUTE statement. I use this method for over 11 years now and it was never a problem until my latest update.

Can this be fixed?

Devart Team
Posts: 1000
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Syntax error on script with EXECUTE statement

Post by azyk » Mon 20 Mar 2017 11:55

This bug was fixed in the latest SDAC 7.3.16 version. Please upgrade SDAC to 7.3.16 and inform us if the specified error is still reproduced.

Post Reply