Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Stored procedure from asp help

Reply
Thread Tools

Stored procedure from asp help

 
 
Mike D
Guest
Posts: n/a
 
      01-14-2005
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
 
Reply With Quote
 
 
 
 
Aaron [SQL Server MVP]
Guest
Posts: n/a
 
      01-14-2005
http://www.aspfaq.com/2448

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




"Mike D" <> wrote in message
news:B1875174-468E-4A76-A43E-...
> 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



 
Reply With Quote
 
 
 
 
Mike D
Guest
Posts: n/a
 
      01-14-2005
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" <> wrote in message
> news:B1875174-468E-4A76-A43E-...
> > 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

>
>
>

 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      01-14-2005
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"


 
Reply With Quote
 
Aaron [SQL Server MVP]
Guest
Posts: n/a
 
      01-14-2005
Sorry.
http://www.aspfaq.com/2248

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




"Mike D" <> wrote in message
news:5401A443-9812-4E7B-84D2-...
> 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" <> wrote in message
> > news:B1875174-468E-4A76-A43E-...
> > > 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

> >
> >
> >



 
Reply With Quote
 
Mike D
Guest
Posts: n/a
 
      01-17-2005
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"
>
>
>

 
Reply With Quote
 
Aaron [SQL Server MVP]
Guest
Posts: n/a
 
      01-17-2005
> 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.)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'Procedure or function <stored procedure name> has too many arguments specified',,,ARGH! Mike P ASP .Net 0 06-19-2006 01:19 PM
HELP!---Stored Procedure in ASP segis bata ASP General 6 04-04-2006 12:49 PM
Call Stored Procedure via ASP.Net (VB) Sam ASP .Net 6 05-11-2005 04:06 PM
Hitting Sql Server Stored Procedure Breakpoint from ASP.NET app =?Utf-8?B?Um9iIEM=?= ASP .Net 0 04-16-2005 12:27 AM
ASP / Stored Procedure SQL Insert Help Bill Kellaway ASP General 7 10-12-2003 06:15 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57