Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Looping "Insert" VB Command

Author  Topic 

vbx
Starting Member

38 Posts

Posted - 2007-10-11 : 10:58:40
I am wanting to create a Insert command that loops through and excel file as many times as there are rows with data. The purpose is to do a bulk insert of data into my db.

Currently the db is being hosted by a company that will not allow me to put the excel file on the server therefore I can not use the BULK INSERT command. Like the BULK insert I also can not set up a "linked Server" for the same reasons with permissions.

I also am working on a budget and do not have the full version of SQL Server 2005. I am only working with Management studio express therfore I don't have SSIS or DTS.

I can use the Insert command and I do expect to have about 120 records that need to be inserted for each session. (Not too many).

Each Record has 41 fields.

Any ideas or direction?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-10-11 : 11:41:46
have you thought about SqlBulkCopy class in .net?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

vbx
Starting Member

38 Posts

Posted - 2007-10-11 : 12:56:28
That is the first I have heard of it?
What exactly is it? It is in Studio 2003?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-10-11 : 15:09:27
it's a part of .net 2.0 so it's in visual studio 2005
http://www.sqlteam.com/article/use-sqlbulkcopy-to-quickly-load-data-from-your-client-to-sql-server

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page
   

- Advertisement -