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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Best insert options.

Best insert options.

Scheduled Pinned Locked Moved Database
databasequestion
5 Posts 4 Posters 1 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.
  • F Offline
    F Offline
    FISH786
    wrote on last edited by
    #1

    I have to check on a couple of things and was thinking of creating about 200million dummy records. I had a for loop and an insert statement in mind. Is there a faster way of creating and inserting such a mass volume of data into a database?

    P W 2 Replies Last reply
    0
    • F FISH786

      I have to check on a couple of things and was thinking of creating about 200million dummy records. I had a for loop and an insert statement in mind. Is there a faster way of creating and inserting such a mass volume of data into a database?

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      What database system? Does it have a bulk insert option? I often use a for or while loop and a parameterized insert statement.

      F 1 Reply Last reply
      0
      • P PIEBALDconsult

        What database system? Does it have a bulk insert option? I often use a for or while loop and a parameterized insert statement.

        F Offline
        F Offline
        FISH786
        wrote on last edited by
        #3

        SQL Server.... Forgot about the bulk insert...I could use that with the for loop.

        I 1 Reply Last reply
        0
        • F FISH786

          SQL Server.... Forgot about the bulk insert...I could use that with the for loop.

          I Offline
          I Offline
          ISoftwareDev
          wrote on last edited by
          #4

          Bulk inserts will probably be the fastest way. Have a look at: http://msdn.microsoft.com/en-us/library/ms188365.aspx[^]

          1 Reply Last reply
          0
          • F FISH786

            I have to check on a couple of things and was thinking of creating about 200million dummy records. I had a for loop and an insert statement in mind. Is there a faster way of creating and inserting such a mass volume of data into a database?

            W Offline
            W Offline
            WoutL
            wrote on last edited by
            #5

            You cold use something like:

            insert into table xxx
            select '1', 3 , 'testdata'
            from northwind..customers a, northwind..customers b, northwind..customers c

            add more northwind x's to get more records. If you don't have the northwind database, any other (big) table on the sqlserver can be used.

            Wout Louwers

            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