Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Posts
    20

    Unanswered: Is there a limit to the number of columns in a table?

    The reason I ask is that I get the following error when attempting to crearte this table using isql:

    1> create table alldbtypes (c_tinyint tinyint, c_smallint smallint, c_int int, c_numeric_1_1 numeric(1,1), c_numeric_38_38 numeric(38,38), c_numeric_17_17 numeric(17,17), c_numeric_9_3 numeric(9,3), c_decimal_1_1 decimal(1,1), c_decimal_38_38 decimal(38,38), c_decimal_17_17 decimal(17,17))
    2> go
    Msg 102, Level 15, State 1:
    Line 1:
    Incorrect syntax near '17'.

    If remove the last column (c_decimal_17_17) from the create statement, the table is created, however there is nothing wrong with the way I have declared that column is the following works fine:

    create table dectable (c_decimal_17_17 decimal(17,17))

    I gather I must be hitting some sort of limitation?

    Thanks,
    Daniel.
    Last edited by danielbrowne; 08-19-04 at 11:43.

  2. #2
    Join Date
    Jun 2002
    Location
    Argentina
    Posts
    78

    Thumbs up

    Try to split the command, may be the isql cut the command because the line is too long.

    create table alldbtypes ( c_tinyint tinyint,
    c_smallint smallint,
    c_int int,
    c_numeric_1_1 numeric(1, 1),
    c_numeric_38_38 numeric(38,38),
    c_numeric_17_17 numeric(17,17),
    c_numeric_9_3 numeric(9, 3),
    c_decimal_1_1 decimal(1, 1),
    c_decimal_38_38 decimal(38,38),
    c_decimal_17_17 decimal(17,17) )
    go

    Bye

    Sebastian

  3. #3
    Join Date
    Aug 2004
    Posts
    8
    Quote Originally Posted by svelasco
    Try to split the command, may be the isql cut the command because the line is too long.

    create table alldbtypes ( c_tinyint tinyint,
    c_smallint smallint,
    c_int int,
    c_numeric_1_1 numeric(1, 1),
    c_numeric_38_38 numeric(38,38),
    c_numeric_17_17 numeric(17,17),
    c_numeric_9_3 numeric(9, 3),
    c_decimal_1_1 decimal(1, 1),
    c_decimal_38_38 decimal(38,38),
    c_decimal_17_17 decimal(17,17) )
    go

    Bye

    Sebastian
    dudes perfectly right...
    i have tables with as many as 28 columns! and absolutely no trouble at all!

    try what sebastian says!

  4. #4
    Join Date
    Feb 2004
    Posts
    20

    Thumbs up

    Thanks guys, that worked a treat.

    Cheers,
    Daniel.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •