Professional Web Applications Themes

Create Table - Coldfusion Database Access

I'm trying to add a table to an existing database file. ID is an auto-increment field. <cfquery datasource="hours" name="PIZZA"> CREATE TABLE projcost (id INT IDENTITY(1,1) NOT NULL, cost_date DATE, cost_type CHAR(50), cost_desc CHAR(255), cost_qty NUMBER(4), cost_each MONEY, cost_total MONEY, job_number CHAR(50), cost_billed CHAR(50), inv_number CHAR(50), picture_location CHAR(255), client_id NUMBER(4), emp_id NUMBER(4) ) </cfquery> Any thoughts? THANKS!...

Sponsored Links
  1. #1

    Default Create Table

    I'm trying to add a table to an existing database file. ID is an
    auto-increment field.

    <cfquery datasource="hours" name="PIZZA">
    CREATE TABLE projcost
    (id INT IDENTITY(1,1) NOT NULL,
    cost_date DATE,
    cost_type CHAR(50),
    cost_desc CHAR(255),
    cost_qty NUMBER(4),
    cost_each MONEY,
    cost_total MONEY,
    job_number CHAR(50),
    cost_billed CHAR(50),
    inv_number CHAR(50),
    picture_location CHAR(255),
    client_id NUMBER(4),
    emp_id NUMBER(4)
    )
    </cfquery>

    Any thoughts?

    THANKS!

    Sponsored Links
    KevinBarbee Guest

  2. #2

    Default Re: Create Table

    For question like this we MUST know what DB you are using.

    You also need to post the exact error message.

    Assuming that you are trying to use MS SQL, then:
    (1) "Date" is not a valid column type. Use datetime.
    (2) "NUMBER(4)" is not a valid column type. Maybe you meantNumeric(4)?



    MikerRoo Guest

  3. #3

    Default Re: Create Table

    Thanks for your reply!
    I'm using MS SQL (Access database).
    I'll change those things you commented on and try again.
    KevinBarbee Guest

  4. #4

    Default Re: Create Table

    Access is not MS SQL. When you say MS SQL, people assume SQL Server.

    And as MikerRoo said, posting the actual error message helps greatly.
    Kronin555 Guest

  5. #5

    Default Re: Create Table

    From a design perspective, I don't see anything resembling a primary key.
    Dan Guest

Similar Threads

  1. Create table overwrites existing table in mssql
    By bmyers in forum Coldfusion Database Access
    Replies: 2
    Last Post: November 25th, 10:00 AM
  2. create tmp table - how to use?
    By Jarek in forum MySQL
    Replies: 3
    Last Post: September 9th, 10:54 PM
  3. How to create a table with dynamic table name
    By cathy wang in forum Informix
    Replies: 3
    Last Post: July 17th, 12:46 PM
  4. CREATE TABLE IN ACCESS
    By Rob in forum ASP
    Replies: 2
    Last Post: July 10th, 01:25 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139