Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Insert Question

Insert Question

Scheduled Pinned Locked Moved Database
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PyroManiak
    wrote on last edited by
    #1

    How do I Insert a copy of a record when I want to change ONLY one field.. INSERT INTO tb SELECT field1, field2, field3, field4, field5 FROM tb AS tb_1 WHERE (field1 = @Value) None of the selected items are the primary key, and this insert works fine for a perfect clone, but I need to be able to modify field1 with a textbox the user can type in. I know there is VALUE keyword.. but I can't seem to get it to work for just field1.

    E 1 Reply Last reply
    0
    • P PyroManiak

      How do I Insert a copy of a record when I want to change ONLY one field.. INSERT INTO tb SELECT field1, field2, field3, field4, field5 FROM tb AS tb_1 WHERE (field1 = @Value) None of the selected items are the primary key, and this insert works fine for a perfect clone, but I need to be able to modify field1 with a textbox the user can type in. I know there is VALUE keyword.. but I can't seem to get it to work for just field1.

      E Offline
      E Offline
      Ennis Ray Lynch Jr
      wrote on last edited by
      #2

      INSERT INTO tb SELECT @someValue, field2, field3, field4, field5 FROM tb AS tb_1 WHERE primaryKey = @primaryKey

      A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane

      P 1 Reply Last reply
      0
      • E Ennis Ray Lynch Jr

        INSERT INTO tb SELECT @someValue, field2, field3, field4, field5 FROM tb AS tb_1 WHERE primaryKey = @primaryKey

        A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane

        P Offline
        P Offline
        PyroManiak
        wrote on last edited by
        #3

        Thank you.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups