Stored procedure from asp help

M

Mike D

I have a stored procedure that I am executing with this SQL
osp_instrument_swap @InstrumentFrom = 'testname', @InstrumentIDTo = 37,
@Schedules = '593, 594, 596, 598, 599, 600, 601, 602, 603, 604, 605, 606,
607, 608, 609, 610, 611, 612, 613, 616'

the @Schedules are ID fields in a table that are integers. I would like to
do an Update blah, Where ScheduleID in (@Schedules) instead of looping. How
can I do this? I have to sent the values to the sproc as text, right? Where
do I covert to the int data type and how?

Thanks for your help
Mike
 
M

Mike D

Am I missing something? I read that and don't see anything that applies to
my problem. Did you post the right link?

Thanks again
Mike
 
B

Bob Barrows [MVP]

Mike said:
I have a stored procedure that I am executing with this SQL
osp_instrument_swap @InstrumentFrom = 'testname', @InstrumentIDTo =
37, @Schedules = '593, 594, 596, 598, 599, 600, 601, 602, 603, 604,
605, 606, 607, 608, 609, 610, 611, 612, 613, 616'

the @Schedules are ID fields in a table that are integers. I would
like to do an Update blah, Where ScheduleID in (@Schedules) instead
of looping. How can I do this? I have to sent the values to the
sproc as text, right? Where do I covert to the int data type and how?

Thanks for your help
Mike
This is relevant:
http://www.sommarskog.se/arrays-in-sql.html

Bob Barrows
 
M

Mike D

Thanks to both of you for your replies. It helps me solve the problem. Does
the new SQL Server (2005?) have any better way to handle arrays than SQL
Server 2000??

Thanks
Mike
 
A

Aaron [SQL Server MVP]

Thanks to both of you for your replies. It helps me solve the problem.
Does
the new SQL Server (2005?) have any better way to handle arrays than SQL
Server 2000??

If you're brave enough to try the CLR, you can code stored procedures and
other modules using .NET languages. So I imagine there is a way to do it
yourself, but nothing native... there are still no such things as "arrays"
in relational data...

There is better XML handling, so you might be able to pass data structures
in that way, as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top