[freetds] MSSQL syntax flavors

Michael Peppler mpeppler at bluewin.ch
Thu Jul 3 07:30:02 EDT 2003


On Thu, 2003-07-03 at 02:21, Andrew Pimlott wrote:
> This is a question along the lines of the observation I made a few
> days ago, about how MS SQL Server interprets commands differently
> depending on what protocol or flags you connect with.  I have
> another example that I haven't been able to resolve.
> 
> I have a create trigger statement (that I didn't write) with a line
> 
>         declare @rc int;
> 
> When I run it with sqsh, I get
> 
>     Line 8: Incorrect syntax near 'int'.
> 
> (line 8 being that line).  If I erase the ';', it runs fine.  The
> original code runs fine in a native MSSQL query tool.

Interesting - maybe the MSSQL query tool silently removes the
semi-colon.

In any case the semi-colon shouldn't be there T-SQL doesn't use
statement terminators like C or perl (and sqsh will often interpret the
; as meaning "go" - i.e. send the current SQL batch to the server).

Michael




More information about the FreeTDS mailing list