help with stored procedure and passing arguments to SELECT

help with stored procedure and passing arguments to SELECT

Post by Noreen Bole » Sat, 04 Oct 1997 04:00:00



Does anyone know if I can pass a parameter into a stored procedure and into
a select statement, if so how - here is the code that gives me the an error

CREATE PROCEDURE sp_copy_data

AS




insert process_TBL(process_type,
                   identifier,
                   service_name)
   select process_type,
          identifier,
          service_name

 
 
 

help with stored procedure and passing arguments to SELECT

Post by Ron Talma » Sat, 04 Oct 1997 04:00:00


Noreen,

The problem is with the variable inside the TSQL statement.

Try dynamic sql:


                   identifier,
                   service_name)
   select process_type,
          identifier,


Ron

On Fri, 03 Oct 1997 13:30:11 -0700, "Noreen Boles"


>Does anyone know if I can pass a parameter into a stored procedure and into
>a select statement, if so how - here is the code that gives me the an error

>CREATE PROCEDURE sp_copy_data

>AS




>insert process_TBL(process_type,
>                   identifier,
>                   service_name)
>   select process_type,
>          identifier,
>          service_name