Groups | Blog | Home
all groups > sql server misc > august 2004 >

sql server misc : EXECUTE 'tsqlstring' with parameters


Anith Sen
8/24/2004 1:54:03 PM
Look up EXECUTE statement & sp_ExecuteSQL procedure in SQL Server Books
Online.

--
Anith

Russ Ferrill
8/24/2004 4:49:44 PM
I'd like to be abe to dynamically build a tsql command to execute a stored
procedure that takes parameters. Is this possible?

Russ Ferrill
8/24/2004 7:45:51 PM
I've looked at the discussion of the execute command in BOL but it says
nothing about passing parameters. I would like to use:
EXEC ( @spname @parm1, @parm2 OUTPUT ) where @spname is the name of the
stored procedure, @parm1 is an input parameter and @parm2 is an output
parameter. When I try this I get an error saying that I need to declare
@parm1, which I have done prior to executing the statment. If I use the same
command with the actual name of the stored procedure in place of @spname it
works just fine, but I really need to be able to select the procedure
dynamically. If there is a way to do this I would greatly appreciate some
suggestions. Thanks very much.

Russ
[quoted text, click to view]

Roji. P. Thomas
8/25/2004 12:25:06 AM
[quoted text, click to view]

YES :)

--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com


[quoted text, click to view]

Roji. P. Thomas
8/25/2004 1:41:39 AM
Refer BOL for sp_ExecuteSQL


--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com


[quoted text, click to view]

AddThis Social Bookmark Button