-
Apr 22nd, 2008, 05:20 AM
#1
Thread Starter
Addicted Member
[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
-
Apr 22nd, 2008, 05:55 AM
#2
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);
-
Apr 22nd, 2008, 06:06 AM
#3
Thread Starter
Addicted Member
Re: Bulk Insert into sql
Im using SQL2005
How do you go about using the Bulk Insert (sorry ive just never used it before)
-
Apr 22nd, 2008, 06:08 AM
#4
-
Apr 22nd, 2008, 06:11 AM
#5
-
Apr 22nd, 2008, 08:06 AM
#6
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|