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 |
|
imranabdulaziz
Yak Posting Veteran
83 Posts |
Posted - 2009-04-09 : 01:57:36
|
| Dear All,I am using sql2005 , C# , asp.net2.0I am trying to upload data from excelsheet to sql tables.Now excelsheet receive customername and address based on that I need to generate loc code (in case of new customer)or if already exist fetch the code from table while uploading the data in a computed column I was writing a function that can fetch loc code based on customer name(to keep it in computed column specification) but problem is function does not support insert stmt and in case of new customer name I need to generates new code.Is there any other way I can geenrate or fetch loc code while uploading Please suggest |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-04-09 : 12:11:55
|
| is this a one time thing or repeated if so SSIS might be your best bet. Otherwise you might have to do it in a few steps1. Create Stored procedure that has a table variable or temp table # (better for performance I think)2. Dump Excel data into table variable or temp tableThen check this outhttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=123495<><><><><><><><><><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
|
|
|