Results 1 to 6 of 6

Thread: CREATE TABLE and number of fields limitations

  1. #1
    Join Date
    Jul 2004
    Posts
    106

    CREATE TABLE and number of fields limitations

    I am trying to create a table runing a command from VB NET

    if I remove the last field it works if I let it it does not

    the following does not work >>>

    CREATE TABLE [Station] (
    [id_Station] COUNTER PRIMARY KEY,
    [ReportId] INTEGER ,
    [Etiquette] CHAR (100) ,
    [Computer] CHAR (100) ,
    [Utilisateur] CHAR (100) ,
    [Type] CHAR (100) ,
    [Marque] CHAR (100) ,
    [Modele] CHAR (100) ,
    [Configuration] CHAR (100) ,
    [Domaine] CHAR (100) ,
    [IP] CHAR (100) ,
    [Serie] CHAR (100) ,
    [RAM] CHAR (100) ,
    [PrixAchat] CHAR (100) ,
    [DateAchat] CHAR (100) ,
    [NumImmo] CHAR (100) ,
    [RefGarantie] CHAR (100) ,
    [DureeGarantie] CHAR (100) ,
    [FinGarantie] CHAR (100) ,
    [ContratMaint] CHAR (100) ,
    [CountMaint] CHAR (100) ,
    [FinMaint] CHAR (100) ,
    [Localite] CHAR (100)
    )


    this one works >>


    CREATE TABLE [Station] (
    [id_Station] COUNTER PRIMARY KEY,
    [ReportId] INTEGER ,
    [Etiquette] CHAR (100) ,
    [Computer] CHAR (100) ,
    [Utilisateur] CHAR (100) ,
    [Type] CHAR (100) ,
    [Marque] CHAR (100) ,
    [Modele] CHAR (100) ,
    [Configuration] CHAR (100) ,
    [Domaine] CHAR (100) ,
    [IP] CHAR (100) ,
    [Serie] CHAR (100) ,
    [RAM] CHAR (100) ,
    [PrixAchat] CHAR (100) ,
    [DateAchat] CHAR (100) ,
    [NumImmo] CHAR (100) ,
    [RefGarantie] CHAR (100) ,
    [DureeGarantie] CHAR (100) ,
    [FinGarantie] CHAR (100) ,
    [ContratMaint] CHAR (100) ,
    [CountMaint] CHAR (100) ,
    [FinMaint] CHAR (100)
    )

    do you know why ?

    thank you

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    There is a limit of number of columns you can have but your CREATE table has definitely hit that.

    How are you creating table from VB.NET? If you are putting the statement in a command string then your string size may be too small to include all column definition.

  3. #3
    Join Date
    Sep 2002
    Posts
    5,938
    Max number of columns in single table is 1024, shouldn't column limit issue in sql server. Does your code work in query analyzer?

  4. #4
    Join Date
    Jul 2004
    Posts
    106
    skhanalit it works perfectly for MS SQL but not for ACCESS 2000 , i need 2 databases depending on customers and I don't know why it doesn't work for access

  5. #5
    Join Date
    Sep 2002
    Posts
    5,938
    Since access has row size limit of 2000 characters while row size limit in sql is 8060 characters.

  6. #6
    Join Date
    Jul 2004
    Posts
    106
    I have reduced a few ome (25) and it works

Posting Permissions

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