April 3, 2004 at 5:33 am
if i use select @Value in a query rather using "if exists" it impacts on query optimization if yes then plz suggest what
Example:
if not exists(select zcmCPR_V_CPRNO from ZCM_CPR where zcmCPR_V_CPRNO=@zcmASM_V_CPRITEMNO)
-----activities--------
or
select @Value=zcmCPR_V_CPRNO from ZCM_CPR where zcmCPR_V_CPRNO=@zcmASM_V_CPRITEMNO
---------------------------------------------------------------
if @Value<>''
------activities-------
April 4, 2004 at 11:17 pm
Hi,
I am not sure from the optimization point of view however from the syntax point of you can us
if @value IS NOT NULL
BEGIN
----Statements ----
END
else
BEGIN
----Statements ----
END
Thanks
Prasad Bhogadi
www.inforaise.com
April 5, 2004 at 1:20 am
Thanks Prasad,but here i am looking for performance issue not syntax
Thanks
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply