Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array Parameters?
Message
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00455030
Message ID:
00455120
Views:
33
>Transact SQL does not support arrays. Often, a temporary table is used to simulate an array where each row contains one element.
>
>-Mike

But then you have to go through the overhead of creating the temporary table and populating it with the 1 - 100 parameters. If you do this with 1 - 100 calls to a stored procedure, YECH!!

So you're kinda stuck with passing a long variable string for the SP to parse and create the temp table with it. But then why not have that as part of the original processing in the first place. Unless you have a generic need of creating "arrays" in many places.

FWIW, I just recently did this. Due to limitations of the current system (data stored in SQL Server, VFP and Access), I needed a way of passing SQL Server a lot of information it used to produce some aggregates. The SP parameter is set to varchar(8000) which when using integer value parameters, gives you approximately 1600 parameter options.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform