As for style, I personally would not do it this way. As others have pointed out isnull() in this case is the same as not using it. You could also short cut the use of @@rowcount by just setting @ret in the select statement. If it returns no rows then it will not be set so it will achieve the same end.

hi Mr. Andrew Cox i put the brackets around the or and u said about @@rowcount i not understand that .i am checking that the select statement contain the row if contain @@rowcount will retun integer.if it contain a value greater than zero then i set @ret =1
–
Surya sasidharFeb 3 '10 at 7:11

I have updated the answer with my version
–
Andrew CoxFeb 3 '10 at 8:41

ok thank you Mr. Andrew Cox thank i am going to write like this only
–
Surya sasidharFeb 3 '10 at 8:46

it does nothing! i.e. it returns NULL if @username is NULL
–
Mitch WheatFeb 3 '10 at 6:58

Mr. taspeotis why because if user can give only username then emailid will give error that is why put isnull. if user give username then emailid will be null. why is that wrong Mr. taspeotis
–
Surya sasidharFeb 3 '10 at 6:59

I thought it did nothing. I'm hoping you're not using it for escaping?
–
ta.speot.isFeb 3 '10 at 7:01