Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Query all data with parameter

Author  Topic 

seyha_moth
Yak Posting Veteran

74 Posts

Posted - 2007-05-01 : 08:00:58
Dear sir or madam

I have a problem related to query. I want to write query with any filter value that can list all data.I want to write:

select * from tblVideo where VideoID=any value

then it will show all data but I don't want to write:

select * from tblVideo

I look forward to hearing from you

Thank you in advance!

Best regard,

seyha moth

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-05-01 : 08:04:58
pass NULL to @VideoID if you want to list all data.

select *
from tblVideo
where
(
@VideoID is null
or VideoID = @VideoID
)



KH

Go to Top of Page

seyha_moth
Yak Posting Veteran

74 Posts

Posted - 2007-05-01 : 08:23:31
Thank you for your reply because I can resolve my problem with your help.

seyha moth
Go to Top of Page
   

- Advertisement -