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. Generate Insert Statement

Generate Insert Statement

Scheduled Pinned Locked Moved Database
comsysadmintoolsquestion
4 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.
  • S Offline
    S Offline
    Sebastien Lachance
    wrote on last edited by
    #1

    Is someone know the way to generate Insert script of a couple of selected record in a databae ? To after execute to script on another databse/server ? sebastien.lachance.blogspot.com

    C 1 Reply Last reply
    0
    • S Sebastien Lachance

      Is someone know the way to generate Insert script of a couple of selected record in a databae ? To after execute to script on another databse/server ? sebastien.lachance.blogspot.com

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Sorry, but that makes no sense. Can you try describing your problem again?


      Do you want to know more? WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums


      Upcoming talk: SELECT UserName, Password FROM Users -- Getting unauthorised access to a SQL Server, and how to prevent it.

      S 1 Reply Last reply
      0
      • C Colin Angus Mackay

        Sorry, but that makes no sense. Can you try describing your problem again?


        Do you want to know more? WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums


        Upcoming talk: SELECT UserName, Password FROM Users -- Getting unauthorised access to a SQL Server, and how to prevent it.

        S Offline
        S Offline
        Sebastien Lachance
        wrote on last edited by
        #3

        Sorry, I will try again. I have a Select statement that select some records. Then I want to send those record on another database. So I wanted to generate a Insert Script, that "Insert" those record. My english is not so great, but I try to become better. Sorry.:omg: sebastien.lachance.blogspot.com

        C 1 Reply Last reply
        0
        • S Sebastien Lachance

          Sorry, I will try again. I have a Select statement that select some records. Then I want to send those record on another database. So I wanted to generate a Insert Script, that "Insert" those record. My english is not so great, but I try to become better. Sorry.:omg: sebastien.lachance.blogspot.com

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          Sebastien_Lachance wrote: My english is not so great That's okay - I read some of your blog and it looks like your English is very good. I guess you were just typing in a hurry. Sebastien_Lachance wrote: I have a Select statement that select some records. Then I want to send those record on another database. So I wanted to generate a Insert Script, that "Insert" those record. If the two tables have the same columns then the easiest thing is:

          INSERT INTO [DestinationDatabase].[dbo].[DestinationTableName]
          SELECT *
          FROM [SourceDatabase].[dbo].[SourceTableName]

          You can, of course, use any select statement that returns the data you need. Does this help?


          Do you want to know more? WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums


          Upcoming talk: SELECT UserName, Password FROM Users -- Getting unauthorised access to a SQL Server, and how to prevent it.

          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