November 10, 2008 at 9:32 am
I've been assigned a simple on-the-side project where I need to load an excel file into an SQL 2k5 DB. I just need to load a list of numbers into a temp table, join them with a view, then capture the results to a CSV file.
The problem I've been having is loading the excel dataset then dumping that dataset into a table. I was hoping to not have to read the dataset row-by-row and 'insert'. I'm using .Net 1.1, so I can't use the SQLBulkLoad.
I was hoping something like this
pseudo code:
DataAdapter1 = Excel
DataAdapter2 = SQL
Dataset = DataAdapter1.Load
DataAdapter2.Insert(Dataset,"SomeTable")
If someone could point me in the right direction as most google hits has involved the new .Net 2.0 SQLBulkLoad or weren't doing what I needed.
November 10, 2008 at 8:55 pm
You've got me... I use OPENROWSET for that type of stuff. Or, better yet, I'll have Excel write an importable CSV when they close the spreadsheet.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 10, 2008 at 9:34 pm
use OPENROWSET, for more info: http://www.mssqltips.com/tip.asp?tip=1202
November 11, 2008 at 1:59 pm
if your situation doesn't allow you to use OPENROWSET, a simple integration services package could do the trick as well.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy