You are here: Re: select * from table where column = @AllValues? « MsSQL Server « IT news, forums, messages
Re: select * from table where column = @AllValues?

Posted by helmut woess on 09/06/05 09:47

Am 5 Sep 2005 14:01:33 -0700 schrieb saturnius@gmx.net:

> Hello,
> I am passing a value to a stored procedure in vb.net to get normally a
> selection of the table. How could I get the complete table without
> writing the code twice? Many thanks in advance ....

You need a second parameter to enable/disable the where criteria. Your
select would look like so:

select * from table where column = @param1 or @param2 = 1

if you use @param2 = 0 then the column is the criteria, if you use @param2
= 1 then you will always get all rows, no matter what's in param1.

bye,
Helmut

 

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

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