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.
Author |
Topic |
Patyk
Yak Posting Veteran
74 Posts |
Posted - 2014-02-24 : 13:43:42
|
I have an excel worksheet "Output" in my excel spreadsheet. d:\data\ExtractData.xlsm Output worksheet has the following 3 column data tableProduct Type Price0175301574 t2 0175301574 t3 0175301574 us 0175301574 ud 0175301574 bu 0175301574 r 28.80170900874 cd 0170900874 k6 0170900874 k5 0170900874 k4 0170900874 k3 0170900874 c 0170900874 k2 0170900874 k1 0170900874 t1 0170900874 t2 0170900874 t3 0170900874 us 80170900874 ud 4.80170900874 bu 4.40170900874 r 4.80170900874 b 4.80170900874 p 4.80175301384 cd 123.240175301384 k6 123.240175301384 k5 132.720175301384 k4 143.780175301384 k3 164.320175301384 c 104.280175301384 k2 160.210175301384 k1 164.320175301384 t1 166.370175301384 t2 184.86I need to write a store procedure to import this data, excluding the records without Price into my identical table in SQL Server. Product are Type are the primary keys.Any Help would be appreciated.thanks |
|
Mar
Starting Member
47 Posts |
Posted - 2014-02-25 : 08:27:40
|
I would recommend writing a macro to loop through the workbook then pass each row to the stored procedure. Unless you are bound to a SP then bulk insert may be an option. |
|
|
|
|
|