Click here to Skip to main content
15,498,859 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have one stored procedure, and I want to check condition that If value =1 then only my condition should check othervise condition not check.
Mitesh Prajapati14 13-Nov-14 1:43am    
Can you post your stored procedure here? so we can give you best solution
virel rakholiya 13-Nov-14 1:51am     CRLF
select F.IsNFO,* from FAInvStatic f inner join SCHEME_DETAILS sd on f.SchCode = sd.SCHEMECODE --and case when fis.IsNFO =1 then DATEADD(DD,5,SD.NFO_CLOSE) >= GETDATE() end if F.isnfo=1 then only condition check else no condition check
Mitesh Prajapati14 13-Nov-14 2:06am     CRLF
As per your stored procedure, you can define like this: DECLARE @isInfo INT SELECT @isInfo = f.IsNFO FROM FAInvStatic Where <<your where condition>> IF ISNULL(@isInfo, 0) = 1 BEGIN <<your condition here>> END ELSE BEGIN <<your condition here>> END
virel rakholiya 13-Nov-14 2:28am    

1 solution

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900