SQL server query problem

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

  1. #1

    Default SQL server query problem

    Hi there,

    Could anyone tll me what wrong with the sql below?

    It doesn't work.

    INSERT INTO courses (applicationid, ccoursename) VALUES (2974,'228'),
    (2974,'328'), (2974,'204'), (2974,'339');

    Thankyou

    Mattastic Guest

  2. Similar Questions and Discussions

    1. One Line Query to Server - Beg
      I own Studio 8 (MX 2004 I believe), and have not used Flash before, though I am a good C programmer, ok in Javascript. I have written a few mashup...
    2. Query on Query and CF casting problem
      I am using a custom tag in MX7 that was working fine in 5 that renders a table. The input to the custom tag is a query and it's columns along with...
    3. Access Query >> sql server
      Would it be possible for me to simply paste this access query into a SQL Server stored procedure: SELECT asplGroupTbl.groupname,...
    4. server query
      Hi Does anybody know if more than one person accesses a shockwave project near enough simutaneously on a server would the second user have to wait...
    5. Query in Index Server: @filename search problem
      I try to do some search in ASP using the filename on an Index server Catalog. The filename begin with date (2001_06_13.html). I do some search with...
  3. #2

    Default Re: SQL server query problem

    The data with the single quotes, is that text or an integer? Check your
    datatype for the column it is being inserted into. The quotes could be causing
    the problem if you are inserting it into a integer datatype

    rmorgan Guest

  4. #3

    Default Re: SQL server query problem

    You can only insert one set of falues at a time, and it looks like you are
    attempting to insert 4. Loop through the insert statement, of write 4 distinct
    insert statements. Are these values "hard coded" or from some other query,
    etc.? If they are from a query, you can use a select statmement in place of the
    VALUES statement.

    INSERT INTO courses (applicationid, ccoursename) VALUES (2974,'228');
    INSERT INTO courses (applicationid, ccoursename) VALUES (2974,'328');
    INSERT INTO courses (applicationid, ccoursename) VALUES (2974,'204');
    INSERT INTO courses (applicationid, ccoursename) VALUES (2974,'339');

    Phil

    paross1 Guest

  5. #4

    Default Re: SQL server query problem

    Thanks for this, you can insert multiple values in mysql though can't you?
    Mattastic Guest

  6. #5

    Default Re: SQL server query problem

    It looks like MySQL supports multiple value lists on inserts, at least
    according to their reference manual: The INSERT ... VALUES form with multiple
    value lists is supported in MySQL 3.22.5 or later.

    What database are you using?

    Phil

    paross1 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