473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Stored procedure from asp help

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
Jul 22 '05 #1
6 1218
http://www.aspfaq.com/2448

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Mike D" <Mi***@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
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

Jul 22 '05 #2
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

"Aaron [SQL Server MVP]" wrote:
http://www.aspfaq.com/2448

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Mike D" <Mi***@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
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


Jul 22 '05 #3
Mike D wrote:
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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #4
Sorry.
http://www.aspfaq.com/2248

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Mike D" <Mi***@discussions.microsoft.com> wrote in message
news:54**********************************@microsof t.com...
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

"Aaron [SQL Server MVP]" wrote:
http://www.aspfaq.com/2448

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Mike D" <Mi***@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
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


Jul 22 '05 #5
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
"Bob Barrows [MVP]" wrote:
Mike D wrote:
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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 22 '05 #6
> 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.

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Trosen | last post by:
Hi Everyone, I hope someone can help, I'm pretty new to pro*c programming. I have the following application setup: a pro*c program calls a stored procedure and recieves a cursor back: the...
3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
3
by: Jarrod Morrison | last post by:
Hi all Im relatively new to using stored procedures and im not sure if it is possible to do what I am trying to do so any help here is greatly appreciated. I am using the variable @MachineName...
7
by: Douglas Buchanan | last post by:
I can't seem to open SQLS2k Stored Procedures in the IDE I am running MDE 2003 Version 7.1.3088 I have a MSDN professional subscription and did a complete install of vs.net Help explains how...
4
by: marc | last post by:
I've been developing a stored procedure that uses a user defined function in the query portion of the procedure. However, since the end product needs to allow for dynamic table names, the UDF will...
3
by: Rhino | last post by:
I've spent the last couple of hours trying to figure out how to debug a Java stored procedure and am just going in circles. The last straw came when I got "Cannot open input stream for default"...
5
by: microsoft.private.windows.netserver.setup | last post by:
I have a very strange thing occurring in the program. I have a dataset retrieved from a stored procedure that just select * from a table. I then try to use the SQlCommandBuilder on the dataset,...
7
by: eholz1 | last post by:
Hello PHP group, Could someone help me out? I have PHP 5.2, Apache 2.0, and MySQL 5.0 running on Linux (Redhat Fedora Core 6). All that works fine. I would like to be able to "call" a stored...
9
by: jyothi1105 | last post by:
Hi all, Here is some information which could help people who want to create stored procedures and execute them in their program. You can create stored procedures in two ways: Through front end...
0
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.