Quantcast
Viewing all articles
Browse latest Browse all 12198

Redundant Else Block

In the first example (A. Returning from a procedure) we don't need the ELSE statement, since: "Statements that follow RETURN are not executed."So another way to write will be:CREATE PROCEDURE findjobs @nm sysname = NULLAS IF @nm IS NULLBEGINPRINT 'You must give a user name'RETURNEND SELECT o.name, o.id, o.uidFROM sysobjects o INNER JOIN master..syslogins lON o.uid = l.sidWHERE l.name = @nm

Viewing all articles
Browse latest Browse all 12198

Trending Articles