dbTalk Databases Forums  

pass param to stored proc

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss pass param to stored proc in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andre
 
Posts: n/a

Default pass param to stored proc - 02-17-2005 , 07:15 PM






I want to pass a param to a stored proc, from a DTS package. I'm able to
pass params to queries in certain Execute SQL Tasks (by using a Global Var
and the ? in the query), but I can't figure out how to pass a param to a
stored proc in an Execute SQL Task. Can I? Or do I have to us an ActiveX
Script Task?

Thanks, Andre



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: pass param to stored proc - 02-18-2005 , 12:28 AM






Do you mean like this?

Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/default.aspx?234)



"Andre" <no (AT) spam (DOT) com> wrote

Quote:
I want to pass a param to a stored proc, from a DTS package. I'm able to

pass params to queries in certain Execute SQL Tasks (by using a Global Var

and the ? in the query), but I can't figure out how to pass a param to a

stored proc in an Execute SQL Task. Can I? Or do I have to us an ActiveX

Script Task?

Thanks, Andre


Reply With Quote
  #3  
Old   
Andre
 
Posts: n/a

Default Re: pass param to stored proc - 02-18-2005 , 11:00 AM



I swear that's what I was doing - I must have had something else wrong.
It's working now. Thanks for the article.

Andre

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Do you mean like this?

Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/default.aspx?234)



"Andre" <no (AT) spam (DOT) com> wrote

I want to pass a param to a stored proc, from a DTS package. I'm able to

pass params to queries in certain Execute SQL Tasks (by using a Global
Var

and the ? in the query), but I can't figure out how to pass a param to a

stored proc in an Execute SQL Task. Can I? Or do I have to us an
ActiveX

Script Task?

Thanks, Andre




Reply With Quote
  #4  
Old   
Andre
 
Posts: n/a

Default Re: pass param to stored proc - 02-24-2005 , 04:28 PM



Allan,

If you're still monitoring this thread, I need to ask a follow-up question.
How do I pass multiple parameters to my sproc? I've tried putting multiple
?, both with and without commas between the ? but to no avail. Is it not
possible to pass multiple parameters to a sproc?
Neither of these work:
EXEC MySproc ? ?
EXEC MySproc ?, ?

Thanks, Andre

"Andre" <no (AT) spam (DOT) com> wrote

Quote:
I swear that's what I was doing - I must have had something else wrong.
It's working now. Thanks for the article.

Andre

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:%23KI$FKYFFHA.2508 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Do you mean like this?

Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/default.aspx?234)



"Andre" <no (AT) spam (DOT) com> wrote

I want to pass a param to a stored proc, from a DTS package. I'm able
to

pass params to queries in certain Execute SQL Tasks (by using a Global
Var

and the ? in the query), but I can't figure out how to pass a param to a

stored proc in an Execute SQL Task. Can I? Or do I have to us an
ActiveX

Script Task?

Thanks, Andre






Reply With Quote
  #5  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: pass param to stored proc - 02-24-2005 , 04:43 PM



Works for me

CREATE PROCEDURE dbo.MyProc @a int, @b int
AS
SELECT @a + @b as Value
GO

In my ExecuteSQL task I do

EXEC dbo.MyProc ?,?

I then map a Global Variable to each ?

Are you getting errors?

Allan

"Andre" <no (AT) spam (DOT) com> wrote

Quote:
Allan,

If you're still monitoring this thread, I need to ask a follow-up
question.
How do I pass multiple parameters to my sproc? I've tried putting
multiple
?, both with and without commas between the ? but to no avail. Is it not

possible to pass multiple parameters to a sproc?
Neither of these work:
EXEC MySproc ? ?
EXEC MySproc ?, ?

Thanks, Andre

"Andre" <no (AT) spam (DOT) com> wrote in message
news:eq0CTtdFFHA.3824 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
I swear that's what I was doing - I must have had something else wrong.

It's working now. Thanks for the article.

Andre

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:%23KI$FKYFFHA.2508 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Do you mean like this?

Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/default.aspx?234)



"Andre" <no (AT) spam (DOT) com> wrote

I want to pass a param to a stored proc, from a DTS package. I'm able

to

pass params to queries in certain Execute SQL Tasks (by using a Global

Var

and the ? in the query), but I can't figure out how to pass a param to
a

stored proc in an Execute SQL Task. Can I? Or do I have to us an
ActiveX

Script Task?

Thanks, Andre





Reply With Quote
  #6  
Old   
Andre
 
Posts: n/a

Default Re: pass param to stored proc - 02-24-2005 , 05:09 PM



I'm so sorry to bother you Allan. I had forgotten to change my sproc name
in the exec statement. The one that was in there only had 1 variable. I
changed it to the new sproc with multiple vars and it works just fine.
grrr. Sorry again, and thank you.

Andre


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Works for me

CREATE PROCEDURE dbo.MyProc @a int, @b int
AS
SELECT @a + @b as Value
GO

In my ExecuteSQL task I do

EXEC dbo.MyProc ?,?

I then map a Global Variable to each ?

Are you getting errors?

Allan

"Andre" <no (AT) spam (DOT) com> wrote

Allan,

If you're still monitoring this thread, I need to ask a follow-up
question.
How do I pass multiple parameters to my sproc? I've tried putting
multiple
?, both with and without commas between the ? but to no avail. Is it not

possible to pass multiple parameters to a sproc?
Neither of these work:
EXEC MySproc ? ?
EXEC MySproc ?, ?

Thanks, Andre

"Andre" <no (AT) spam (DOT) com> wrote in message
news:eq0CTtdFFHA.3824 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
I swear that's what I was doing - I must have had something else wrong.

It's working now. Thanks for the article.

Andre

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:%23KI$FKYFFHA.2508 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Do you mean like this?

Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/default.aspx?234)



"Andre" <no (AT) spam (DOT) com> wrote

I want to pass a param to a stored proc, from a DTS package. I'm
able

to

pass params to queries in certain Execute SQL Tasks (by using a
Global

Var

and the ? in the query), but I can't figure out how to pass a param
to
a

stored proc in an Execute SQL Task. Can I? Or do I have to us an
ActiveX

Script Task?

Thanks, Andre







Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.