Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts

    ASP/SQL: Creating a table in database

    Hey.
    I'd like to create a table in an existing database but it doesn't seem to work.
    I get this error when trying to execute the SQL statement:
    Code:
    Microsoft JET Database Engine (0x80040E14)
    Syntax error in CREATE TABLE statement.
    /system/installation.asp, line 188
    This is how my statement looks like:
    Code:
    CREATE TABLE Insert table name (id INT NOT NULL AUTO_INCREMENT,test1 VARCHAR,test2, test3 VARCHAR, PRIMARY KEY id);
    What am I doing wrong?

    Thanks for the help!

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Your create table code is wrong. There is no insert table. The code is

    Code:
    CREATE TABLE TableName 
    (
           id int IDENTITY NOT NULL PRIMARY KEY CLUSTERED,
           text1 varchar(50),
           text2 text,
           text3 varchar(75)
    )

  • Users who have thanked miranda for this post:

    BarrMan (09-24-2007)

  • #3
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    Thanks Miranda!
    I knew there wasn't an SQL statement as this but I got this value of a form value and that's why it caused the error.
    I just didn't notice it.

    Thanks again


  •  

    Posting Permissions

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