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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Storing data in varchar(max)

Author  Topic 

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-09-09 : 11:26:31
Hi All,

I have a CSV variable in a SP, that builds up a CSV & returns a status code to the .net page

PROBLEM VS SOLUTION (Whats the best way to achieve this ? )


1. Do I save the CSV file into a varchar(max) column and delete it after execution is complete ?

OR

2. Do I rebuild the csv all over again ?
(A trigger calls a SP to process the CSV values that had a status of 0)

If option 1 is better, once the processing has been done the column is deleted.

If option 2 is chosen, then the calling SP has to do a select in the table and rebuild the string, before processing the values

Whats the best option here ?

thanks


Yes O !

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-09 : 11:50:23
May we see your code so that we can understand?

You should strive to normalize your data.
INSERT all values in CSV parameter into a table and join that table later.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-09-09 : 12:02:04
My code is long.

Its basically...

1. A CSV passed to a SP
2. A split function that loops thru and checks to make sure each value meets a certain standard
3. If everything is ok, it passes a status back to the calling app

It then makes a log and a trigger is fired to execute a .dll which processes the csv with correct values. Completely transparent to the user.

PROBLEM

1. Its either the .dll component does a select to retrieve the values afresh
or
2. It just assigns the csv to a column and the dll retrieves the value

which is best ?

Yes O !
Go to Top of Page
   

- Advertisement -