Professional Web Applications Themes

Inserting data to SQL - Coldfusion - Getting Started

Hi all Just a quick question. I wish to insert data to an SQL Server database. Its OK I have got the template working - just after some advice as to the best approach. In Microsoft Access I can set the RecordID to be an auto generated number. I am unable to in SQL Server (to the best of my knowledge) to set the RecordID as an auto generated number. So what is the best approach - do I included on the form a text box to allow the user to enter a recordid and then when I am inputing ...

  1. #1

    Default Inserting data to SQL

    Hi all Just a quick question. I wish to insert data to an SQL Server
    database. Its OK I have got the template working - just after some advice as
    to the best approach. In Microsoft Access I can set the RecordID to be an auto
    generated number. I am unable to in SQL Server (to the best of my knowledge)
    to set the RecordID as an auto generated number. So what is the best
    approach - do I included on the form a text box to allow the user to enter a
    recordid and then when I am inputing the data to the database I include this
    field as one of the fields to include. Is there any other way possible to
    automatically include a unique record key? Kind regards

    toby007 Guest

  2. #2

    Default Re: Inserting data to SQL

    Hi Toby,
    >I am unable to in SQL Server (to
    >the best of my knowledge) to set the RecordID
    >as an auto generated number.
    MS SQL server does have a field type that can be set to auto generate a
    unique integer ID. I think it's called autonumber, but if you look in
    the table design section of enterprise manager you'll see it there.

    Regards,
    Roy F.

    toby007 wrote:
    > Hi all Just a quick question. I wish to insert data to an SQL Server
    > database. Its OK I have got the template working - just after some advice as
    > to the best approach. In Microsoft Access I can set the RecordID to be an auto
    > generated number. I am unable to in SQL Server (to the best of my knowledge)
    > to set the RecordID as an auto generated number. So what is the best
    > approach - do I included on the form a text box to allow the user to enter a
    > recordid and then when I am inputing the data to the database I include this
    > field as one of the fields to include. Is there any other way possible to
    > automatically include a unique record key? Kind regards
    >
    Roy F Guest

  3. #3

    Default Re: Inserting data to SQL

    one sql server numeric column per table can have an "identity" attribute which
    works simlar to access's autonumber (only better of course). crack open your
    sql server's enterprise manager and select the numeric column (should be some
    form of integer as it you can only add whole numbers to the sequence) you want
    to have the identity property (or add a new one). make that column NOT NULL
    (unclick the check mark in the top part of the dialog),in the lower part of the
    dialog you should see an identity row, make that "yes". that's it.



    PaulH Guest

Similar Threads

  1. Replies: 2
    Last Post: March 8th, 11:57 AM
  2. Inserting Data into DB
    By sbitcorp in forum Coldfusion - Getting Started
    Replies: 1
    Last Post: February 16th, 09:29 AM
  3. Inserting Data
    By robert_raw webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 1
    Last Post: July 16th, 03:01 PM
  4. Replies: 1
    Last Post: July 10th, 08:29 PM
  5. inserting data...
    By Geoff Berrow in forum PHP Development
    Replies: 1
    Last Post: June 27th, 02:31 PM

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