Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Sql Server Programming

Use variable as parameter in stored procedure


Hi,

I have a scheduler job that's defined as below:

           EXEC dbo.spCheckSystemFailure @Threshold = 5

Now the Threshold is stored in a database table, "SystemParameter".
The way to get @Threshold is by executing the following statement:

          SELECT SystemParameterValue
          FROM SystemParameter
          WHERE SystemParameterName = 'Threshold'

Anyone can tell me the best way to streamline this job, i.e., to get
Threshold from "SystemParameter" table,and execute the stored
procedure with this value as @Threshold?

Thanks!

You mean this?

declare @MyVar int
select @MyVar = SomeColumnName
  from tableA

exec someproc @Threshold = @MyVar

"Curious" <fir5tsi@yahoo.com> wrote in message

news:1181000908.159903.149000@q69g2000hsb.googlegroups.com...

That's what "I" think he/she means too! :-)

--
TheSQLGuru
President
Indicium Resources, Inc.

"Robbe Morris - MVP C#" <i@eggheadcafe.com> wrote in message
news:u1WV5swpHHA.4112@TK2MSFTNGP04.phx.gbl...

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc