[freetds] Please help: "create view" failing

Orlando Colamatteo Ocolamatteo at affinitygroup.com
Thu Nov 9 11:28:00 EST 2006


This is not an issue with FreeTDS, rather it is a dbms issue you are
running into. Having a semi-colon at the end of a sql statement inside a
view is considered invalid syntax in SQL Server 2000 however SQL Server
2005 now permits this syntax.

-opc3

-----Original Message-----
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Paul Rensing
Sent: Thursday, November 09, 2006 9:16 AM
To: FreeTDS Development Group
Subject: [freetds] Please help: "create view" failing

Hi there,

I am having trouble with running a "create view" in the Mono (free .NET)
client. The problem lies with the TDS it generates. I have managed to
duplicate the issue with the FreeTDS tsql client, but now I realize that
the real problem lies with the exact behaviour of TDS. 

Note that I am running on Linux against an MS SqlServer 2000. My FreeTDS
installation is 0.64.

The statement I am trying to execute is:
    create view TEST_VIEW as select * from otherdb..SOME_TABLE If I
start tsql and do:
    1> create view TEST_VIEW as select * from otherdb..SOME_TABLE
    2> go
it works just fine. If, however, I add a ";" at the end of the first
statement, ie:
    1> create view TEST_VIEW as select * from otherdb..SOME_TABLE;
    2> go
then I get the error:
        Msg 170, Level 15, State 1, Server XXX, Line 1
        Line 1: Incorrect syntax near ';'.

I just don't understand what the problem is. Normally, a semi-colon is
not a problem. Certainly, if I do a select with or without the ";", I
don't see any behaviour change.

Can someone please explain why the semi-colon is breaking the SQL? I
would like to understand this so I can try to work around the problem
(the ";" is inserted automatically in Mono).

	Thanks for the help,

		Paul Rensing
--
Paul Rensing <paulrensing at verizon.net>
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds


More information about the FreeTDS mailing list