Skip to Content.
Sympa Menu

freetds - [freetds] Issue creating SQL Server table via tsql.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Glenn, Chris" <Glenn AT addsys.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Issue creating SQL Server table via tsql.
  • Date: Thu, 8 Dec 2005 17:33:49 -0500

Hi everyone-



I'm having a weird problem attempting to create a table via tsql
connected to a SQL Server.

I'm receiving a sql syntax error after entering information for a
particular column.



If I add a character to the beginning of the column name, then the error
occurs after entering the next column.

If I add a character to the beginning of the second column, then I can
enter the remaining columns and create the table.



Tsql;

Compile-time settings (established with the "configure" script):


Version: freetds v0.63


MS db-lib source compatibility: no


Sybase binary compatibility: unknown


Thread safety: yes


iconv library: yes


TDS version: 7.0

iODBC: no


unixodbc: no


(I've tried different TDS versions (5.0 and 8.0) and the problem still
occurs)



1> select @@version


2> go




Microsoft SQL Server 2000 - 8.00.760 (Intel X86)

Dec 17 2002 14:22:05

Copyright (c) 1988-2003 Microsoft Corporation

Standard Edition on Windows NT 5.2 (Build 3790: )



I. First attempt - error messge occurs immediately after <CR>.


1> create table ACCOUNTS

2> ( account_num int not null,

3> name varchar(40) not null,

4> first_name varchar(40) null,

5> street_number varchar(15) null,

6> street1 varchar(40) null,

7> last_hold_date smalldatetime null,

8> statement_message_code smallint null,

9> govt_compliance_charge char(1) null,

Msg 170, Level 15, State 1, Server CHAOS, Line 8

Line 8: Incorrect syntax near ','.



II. Added an 'x' in front of the column name above. Error now occurs
after entering the next column.

1> create table ACCOUNTS

2> ( account_num int not null,

3> name varchar(40) not null,

4> first_name varchar(40) null,

5> street_number varchar(15) null,

6> street1 varchar(40) null,

7> last_hold_date smalldatetime null,

8> statement_message_code smallint null,

9> xgovt_compliance_charge char(1) null,

10> govt_compliance_amount smallmoney null,

Msg 170, Level 15, State 1, Server CHAOS, Line 9

Line 9: Incorrect syntax near ','.



III. Added an 'x' in front of the the column name that received error
in step II. Now the table creates properly?

1> create table ACCOUNTS

2> ( account_num int not null,

3> name varchar(40) not null,

4> first_name varchar(40) null,

5> street_number varchar(15) null,

6> street1 varchar(40) null,

7> last_hold_date smalldatetime null,

8> statement_message_code smallint null,

9> xgovt_compliance_charge char(1) null,

10> xgovt_compliance_amount smallmoney null,

11> next_year_volume money null,

12> company_form_code smallint null

13> )

14> go

1>



Am I missing a configuration option or setting?



Chris Glenn






Archive powered by MHonArc 2.6.24.

Top of Page