Can't insert into SQL Server

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Can't insert into SQL Server

    Hi,

    I've been having a problem with this for a while.

    It seems that I cannot insert records into a table in SQL Server, and this
    happens using either insert method (SQL cfquery insert and cfinsert tag).

    But when running through the example PDF files using the Compass Travel access
    file, I can insert into that perfectly fine.

    Does anyone know why I may not be able to insert into an SQL Server table.
    I've tried 2000 & 2005 with no luck.

    KevCB Guest

  2. Similar Questions and Discussions

    1. 500 NULL error on DB Insert (SQL Server)
      I am getting a "500 NULL" error when inserting a large textfile into a "Text" column in SQL Server. I am running MX 7.0.1 on Windows 2000 Server...
    2. Insert date to SQL server creates error
      Hi All, Thanks in Advance! I am attempting to insert a date into a SQL 2000 datetime field from an asp form. The problem that I am encountering...
    3. can't insert dates in SQL Server 2000
      Perhaps that's because what you're actually converting is 31 divided by 7 divided by 2003 instead of the string '31/07/2003'. Ray at home --...
    4. Server behavior ' insert record'
      Every time I use this server behavior there comes a red '!' in front of it ?? Does someone know why this happens ?? Thanks a lot Georges J.S.
    5. Have server get value for column on Insert?
      Consider: CREATE TABLE Transactions ( TransactionGUID uniqueidentifier, TransactionNumber int, TransactionDate, SessionGUID, ...) CREATE...
  3. #2

    Default Re: Can't insert into SQL Server

    Originally posted by: KevCB
    Hi,

    I've been having a problem with this for a while.

    It seems that I cannot insert records into a table in SQL Server, and this
    happens using either insert method (SQL cfquery insert and cfinsert tag).

    But when running through the example PDF files using the Compass Travel access
    file, I can insert into that perfectly fine.

    Does anyone know why I may not be able to insert into an SQL Server table.
    I've tried 2000 & 2005 with no luck.

    Also I know that the datasources are OK, as I can create select queries for
    cfselect tags.

    What happens when you try?

    Dan Bracuk Guest

  4. #3

    Default Re: Can't insert into SQL Server

    Check the permissions in SQL server manager.. you might not have the rights
    to allow inserts. This happens a lot when you try to export a database from
    one server then import into another.. also check in the cf admin page that it
    says to allow inserts

    Musella Guest

  5. #4

    Default Re: Can't insert into SQL Server

    Check the permissions in SQL server manager.. you might not have the rights to
    allow inserts. This happens a lot when you try to export a database from one
    server then import into another.. also check in the cf admin page that it says
    to allow inserts

    I have looked at what you suggested, but still can't get this working.
    I have looked in the CF admin and all of the SQL statements were checked
    (INSERT, UPDATE, DELETE etc.).
    I wasn't sure about the permissions for SQL SERVER so I did a quick GRANT ALL
    to test this out, but after I submitted the page it still didn't insert into
    the database.

    What happens when you try?

    What seems to happens after I submit is it goes to the next page, but it comes
    back as blank (apart from the banner along the top). I set up some text to
    output if it is inserted correctly, but this doesn't show at all.

    KevCB Guest

  6. #5

    Default Re: Can't insert into SQL Server

    Originally posted by: KevCB
    What seems to happens after I submit is it goes to the next page, but it comes
    back as blank (apart from the banner along the top). I set up some text to
    output if it is inserted correctly, but this doesn't show at all.

    Are you getting any errors? Sometimes they show up way at the bottom, and you
    have to scroll down to see it. If not, put a simple message and cfabort after
    your input query. See if your message displays. Look at your debugging info
    to see if your query ran. If it did, your problem lies elsewhere.

    Dan Bracuk Guest

  7. #6

    Default Re: Can't insert into SQL Server

    I've managed to sort this problem out now. Thanks for your help, but it was my
    mistake that was stopping it from working.

    I had set up a variable to be either 'yes' or 'no'. The page is set to 'yes'
    when it loads up, but I made the mistake of set the whole page to 'no' by
    accident instead of another variable to check for validation on the previous
    pages form.

    D'oh

    KevCB Guest

Posting Permissions

  • You may not post new threads
  • You may 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