Friday, October 15, 2010

implementing-a-dynamic-where-clause

http://www.sqlteam.com/article/implementing-a-dynamic-where-clause

SELECT Cus_Name,
Cus_City,
Cus_Country
FROM Customers
WHERE Cus_Name = COALESCE(@Cus_Name,Cus_Name) AND
Cus_City = COALESCE(@Cus_City,Cus_City) AND
Cus_Country = COALESCE(@Cus_Country,Cus_Country)

No comments:

Post a Comment

Followers

Blog Archive