Skip to Content.
Sympa Menu

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

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Paul Rensing <paulrensing AT verizon.net>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Please help: "create view" failing
  • Date: Thu, 09 Nov 2006 11:16:16 -0500

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>




Archive powered by MHonArc 2.6.24.

Top of Page