View Single Post
  #2 (permalink)  
Old September 30th, 2007, 07:14 AM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

It looks about right but you can simplify the WHERE clause to get rid of the CASE statements:
Code:
(UniqueName = @UniqueName OR @UniqueName IS NULL)
So this part will be true if the UniqueName field matches the @UniqueName parameter or if the @UniqueName parameter is null.

--

Joe (Microsoft MVP - XML)
Reply With Quote