Skip to Content.
Sympa Menu

freetds - Re: [freetds] Please help: "create view" failing

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Orlando Colamatteo" <Ocolamatteo AT affinitygroup.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Please help: "create view" failing
  • Date: Thu, 9 Nov 2006 09:28:00 -0700

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




Archive powered by MHonArc 2.6.24.

Top of Page