Expand|Select|Wrap|Line Numbers
- BEGIN
- SET NOCOUNT ON;
- SELECT
- pi.*
- FROM rates pi
- WHERE
- (pi.pid = @pid or @pid is NULL)
- AND
- (pi.scode = @scode or @scode is NULL)
- END
If scode = 'p' then
where condition must be like this:
WHERE
(pi.pid = @pid or @pid is NULL)
AND
((pi.scode = @scode and pi.scode ='p' ) or @scode is NULL)
Please tell me how to modify the code?
thks