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)
 select statement

Author  Topic 

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2005-01-16 : 19:24:36
Hi All,

I have a column 'name' in table, which has data like
abc
Abc
ABC

I need to get list of names if it contains any lower case character.
How i can do that?

Thanks


mk_garg

nr
SQLTeam MVY

12543 Posts

Posted - 2005-01-16 : 19:27:59
select name
from tbl
where name like '%[a-z]%' collate Latin1_General_BIN


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-01-16 : 19:29:29
SELECT *
FROM MyTable
WHERE MyNameColumn COLLATE Latin1_General_BIN LIKE '%[a-z]%'



Don't you ever sleep Nigel?

Kristen
Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2005-01-16 : 19:31:21
I am getting following error:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'collate'.

I am using Sql serevr 7.0.

Thanks

mk_garg
Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2005-01-16 : 19:35:51
Kristen i am getting same error.
I think SQL Server 7.0 does not support Collate

mk_garg
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2005-01-16 : 19:52:22
Nope it doesn't.
maybe

select name
from tbl
where convert(varbinary(100),name) <> convert(varbinary(100),upper(name))

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2005-01-17 : 00:36:28
Worked

Thanks

mk_garg
Go to Top of Page
   

- Advertisement -