Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Vivaldi
Constraint Violating Yak Guru
298 Posts |
Posted - 2001-08-07 : 09:43:04
|
| Well,I have a proc that needs to be changed (client changed mind) and needs to accept another parameter. I was hoping i could do something like.if (@newparm < 1) *** Append an AND condition(*** something very easily done in ASP)The whole sql statement is being declared for a cursor however.I read the article on dynamic sql.Not sure I can apply it however.Code to follow....Declare curs CURSOR Forselect ci.caseid,lastname + ', ' + firstname + ' ' + middlename,cex.enrolldate,servicecounty,cex.componentenrollid FROM CaseInfo ci inner join (componentenroll cex left outer join componentexit cx on cex.componentenrollid = cx.componentenrollid and cx.componentenrollid IS NULL) on cex.caseid = ci.caseid inner join StaffCase sc on sc.caseid = ci.caseid AND sc.staffid = @staffid where ci.caseid not in (select caseid from ExitInformation)************* would like to insert logic here ***** order by cex.enrolldate OPEN curs......................................Is there another way to handle an optional parameter?Composing temporary solutions to permanent problems |
|
|
|
|
|