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
 SQL Server Development (2000)
 Sqlquery

Author  Topic 

sqldba2k6
Posting Yak Master

176 Posts

Posted - 2007-06-20 : 15:02:35
I want to write a stored procedure with only one input parameter
The Input parameters should search all the three columns values and results the data

**I dont want select * from tableA where col3='4A3F'

TableA
-------

Col1 Col2 Col3
----- ---- ----
4625 5986 4A3F
5FW4 9865 6598
64PO 695E 5SPD
3625 8982 5201



Exec proce '4A3F'

Output:

Col1 Col2 Col3
----- ---- ----
4625 5986 4A3F

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-06-20 : 15:08:52
select * from tableA
where @param in (col, col2, col3)


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-21 : 10:21:17
Sounds you have denormalised structure

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -