You are here: Re: optional parameter in sql query « MsSQL Server « IT news, forums, messages
Re: optional parameter in sql query

Posted by Erland Sommarskog on 10/06/06 11:31

parez (psawant@gmail.com) writes:
> I want to use the td column in the query only if @td variable is
> passed to the stored procedure.

Then the original pair of queries you had, will work fine.

For a much longer discussion of the more general problem when you have
many of these @td parameters, there is an article on my web site:
http://www.sommarskog.se/dyn-search.html.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация