Results 1 to 6 of 6

Thread: [RESOLVED] Bulk Insert into sql

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    137

    Resolved [RESOLVED] Bulk Insert into sql

    Hi

    Looking for some advice and maybe an example.

    basically I have an Access Database that im opening into a datatable in VB

    I then want to save this data into a SQL table. Now there are roughly 80,000 records in this table, and this will need ot be done fortnightly.

    I can't just move the access db over to SQL as im not allowed

    Is there an easy way of doing this from VB? as this is going to run as part of a bigger process. I know It could be done using import feature in sql but the person that will be running this won't have access to sql

    thanks in advance

  2. #2
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424

    Re: Bulk Insert into sql

    What version of SQL Server you are using. SQL Server 2005 supports 'BULK INSERT' command, otherwise you can insert multiple rows like this in one go:

    INSERT INTO MyTable (FirstCol, SecondCol)
    VALUES (‘First’,1);
    INSERT INTO MyTable (FirstCol, SecondCol)
    VALUES (‘Second’,2);
    INSERT INTO MyTable (FirstCol, SecondCol)
    VALUES (‘Third’,3);
    INSERT INTO MyTable (FirstCol, SecondCol)
    VALUES (‘Fourth’,4);
    INSERT INTO MyTable (FirstCol, SecondCol)
    VALUES (‘Fifth’,5);

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    137

    Re: Bulk Insert into sql

    Im using SQL2005

    How do you go about using the Bulk Insert (sorry ive just never used it before)

  4. #4

  5. #5

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    137

    Re: Bulk Insert into sql

    cheers jmcilhinney thats spot on with a little tweaking

Posting Permissions

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



Click Here to Expand Forum to Full Width