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


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?


You mean this?

declare @MyVar int
select @MyVar = SomeColumnName
  from tableA

exec someproc @Threshold = @MyVar

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


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

Indicium Resources, Inc.

"Robbe Morris - MVP C#" <i@eggheadcafe.com> wrote in message

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