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 2008 Forums
 Transact-SQL (2008)
 find value in all columns in table

Author  Topic 

asifbhura
Posting Yak Master

165 Posts

Posted - 2011-05-20 : 10:36:36
Hello,

I have one table named with ProjectDetails

I have around 20 columns with int, bigint,nvarchar,varchar...

I want to find value in each column

Regards

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2011-05-20 : 14:33:02
select * from ProjectDetails

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-05-20 : 16:18:44
I think they mean
DECLARE @x varchar(20)
SELECT * FROM myTable99
WHERE Col1 = @x
OR Col2 = @x
etc

Or maybe

WHERE Col1 LIKE '%' + @x + '%'
OR Col2 LIKE '%' + @x + '%'
ect



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2011-05-23 : 06:37:10
Picky picky picky. I am not a mind reader like Peter.

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -