I’m am trying to create a StoredProc that will, if a value is below a limit it will insert one value or if the value is above a limit then it will insert another value. Sort of like this in C programming:
-
if (ValueOriginal >= 3)
-
{
-
if (ValueOriginal <= 10)
-
ValueToInsert = ValueOriginal;
-
else
-
ValueToInsert = 0;
-
}
-
else
-
ValueToInsert = 0;
Hope Someone can help me
NormanTheDane
If u just want to know how to use IF state ment in SQL Server,
Format one:
IF <condition> <then code to be executed when condition true>
Format two:
IF <condition>
BEGIN
<then code to be executed when condition true>
END
ELSE
BEGIN
< else code to be executed when condition is false>
END