Ryan1 (8/16/2013)
Thank you.So essentially this procedure is querying dbo.table and whenever it finds a null value it replaces the null value with one of the call variables we initiated the procedure with?
Yes the procedure is querying that table. But no on the null replacement.
Your where clause is taking advantage of the ISNULL to determine if the input parameter is null. If the input is null, then it uses the column value for the relative condition.
If the input parameter is not null, then it uses the input parameter in the relative condition.
for instance
where adult = isnull(@adult,adult) could be rewritten as this pseudo-code)
If @adult is null
then
Where adult = adult
If @adult is not null
then
where adult = @adult
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events