Skip to Content.
Sympa Menu

freetds - Re: [freetds] MSSQL syntax flavors

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Peppler <mpeppler AT bluewin.ch>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] MSSQL syntax flavors
  • Date: Thu, 03 Jul 2003 06:30:02 -0000

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






Archive powered by MHonArc 2.6.24.

Top of Page