Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delimited string parsing question
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Delimited string parsing question
Divers
Thread ID:
00667270
Message ID:
00667270
Vues:
56
Hi,

I am in the process of writing a stored procedure that will be doing the preprocessing for a few of the huge reports our system generates. Rather than sucking 20,000 records into an ADO recordset and doing the sorting, filtering, grouping, etc - at the client - it seems to make more sense to do all of that in a SP and return a much smaller recordset to the client.

For a certain report in this system, administrative users can select certain cost centers to run a report for. The client app will have to send this info as a parameter to the SP in a comma delimited string ( i.e. '2010,1110,3340,5560').

I'm thinking that the best approach is to parse this string into a 'table' variable, then select the records into a cursor and proceed to loop through the cursor and do the processing.

My question is this: Not being an expert with the built-in SQL functions, what is the best way to parse a string such as mentioned above, and populate my 'table' variable.

Any assistance would be appreciated.

Regards,

Al
Al Williams

Anola MB, CANADA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform