Link to home
Start Free TrialLog in
Avatar of bibi92
bibi92Flag for France

asked on

Question about sql statement

Hello,

In a script, I have this statement for update stored procedures :
UPDATE sql_sp
      SET    SQL = REPLACE(SQL,  '@c6
      ,@c7' ,  '@c6
      ,@c7, '''+@schemasource+'''' )
      where name = 'sp_MSins_'+@schemasource+'ACCOS'

How can I put it in a table parameters?

Thanks

bibi
        
Avatar of Kalyanum Deepak Kumar
Kalyanum Deepak Kumar
Flag of India image

Hi bibi,

Cound not understand the question. Is that to place the parameters in a table and send them to the stored procedure.
ASKER CERTIFIED SOLUTION
Avatar of EugeneZ
EugeneZ
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How can I put it in a table parameters?

"it": What?

"a parameters" : parameters is plural, that grammar makes no sense at all.

Did you mean: "How can I put parameters into a table?"

Well, that's not really the problem, is it? You can put values into a table. The question is how to use table records to replace parameters, and that's simply by joining the table with parameters and replacing parameters with the tablename.fieldname syntax.

In a simpler example:

Select * from table where name = @name

create a table named parameters with a field name, then you can instead do:

Select table.* from table inner join parameters on table.name = parameters.name

Bye, Olaf.
Avatar of bibi92

ASKER

Thanks bibi