|
Subject:
|
sql server and asp if statement
|
|
Posted By:
|
shoakat
|
Post Date:
|
11/2/2004 3:14:00 PM
|
is there any way to use an if statement in a SQL Server. I have written a code in an asp. I want to check the code in SQL.
strUpdate = "update tblCustRate set dtRateFrom =" & ndateFrom & _ ", dtRateTo =" & ndateUntil& _ ", decHourlyRate=" & nHourlyRate '" where iEmpID=" &iEmpID&_ '" and iTaskID= " & iTaskID &_ '" and iProjDetID=" & iProjDetID if resType ="E" then strUpdate= strUpdate & " where iEmpID= " & iEmpID &_ " and iTaskID= " & iTaskID &_ " and iProjDetID=" & iProjDetID else strUpdate=strUpdate & " where iSubcontID = " & iSubcontID &_ " and iTaskID= " & iTaskID &_ " and iProjDetID= " & iProjDetID end if
|
|
Reply By:
|
shahchi1
|
Reply Date:
|
11/2/2004 5:50:34 PM
|
You can create a Stored Procedure in SQL Server.
IF <Boolen Expression> BEGIN Your SQL Statements END ELSE BEGIN Your SQL Statements END
|
|
Reply By:
|
shoakat
|
Reply Date:
|
11/2/2004 6:38:16 PM
|
will any one write the stored procedure. Since I am the new to the sql. I dont know how? Thanks
|