Results 1 to 5 of 5

Thread: Batch insert

  1. #1
    Join Date
    Jan 2004
    Posts
    3

    Unanswered: Batch insert

    I'm using ASP.net to do a Select and I want to insert all the results into a table that is stored locally
    I can put an SP local but cant put on the other DB

    How would i achieve this batch insert? is it possible?

    thanks
    Mark

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    I am confused What is it that you need?

    If you're talking about being able to do BULK INSERT from a stored procedure, you can do that, but you'll have to grant the User ID that will execute it Bulk Insert Administrator server role (bulkadmin.)

  3. #3
    Join Date
    Jan 2004
    Posts
    3
    Sorry
    I have 2 tables
    table 1 - remote, cant use an SP
    table 2 - local, can use a SP

    I do a select on Table1 and it returns the results,

    I want to insert all these results into table 2

    whats the best way to do that? (most efficient)

    Cheers
    Mark

  4. #4
    Join Date
    Jan 2004
    Posts
    3
    The problem is that the first table is really slow to access, I have a string of booking Id's i need to pass it and it keeps timing out...its the DB! its on rubbish HW and is badly designed but I cant do anything about that so I have to use the most efficent method of getting the data out, or simply copying the required records between the 2 tables

    remember the rubbish DB is not local and I only have read access to it!

    whats the most efficent method I should use?

    thanks
    Mark

  5. #5
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Create a stored procedure on the remote server that retrieves rows via SELECT, and call it instead of doing SELECT from your local server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •