General information
Forum:
Microsoft SQL Server
Title:
Duplicate macro in the where clause
How would I duplicate making a portion of the where clause of a procedure change depending upon what value was passed to th procedure? In vfp I could use the macro substitution and do the following:
If empty(x)
whereclause = ' .t.'
else
whereclause = ' x = y'
endif
select * from tablea where b=c and &whereclause
How would I duplicate this in my stored procedure with out making the select statement twice?
Thanks in advance
Kelly
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only