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
 General SQL Server Forums
 New to SQL Server Programming
 Select where column contains ","

Author  Topic 

raysefo
Constraint Violating Yak Guru

260 Posts

Posted - 2011-07-27 : 15:01:19
Hi,

I am using SQL server 2008 R2 and I want to query, if a column has ","

Is there a way to do it?

Best Regards.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-07-27 : 15:02:08
select ...
from t1
where col1 like '%,%'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Ghanta
Yak Posting Veteran

96 Posts

Posted - 2011-07-27 : 16:39:44
ray u mean data in column or column name?

if column name then:


select * from INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME like '%,%'
Go to Top of Page

raysefo
Constraint Violating Yak Guru

260 Posts

Posted - 2011-07-28 : 01:28:50
thanks tkizer, thats what I want
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-07-28 : 12:27:40
You're welcome, glad to help.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -