Skip to main content
nikos101
Inspiring
February 2, 2010
Answered

Test for first letter capitalisation like so in ms sql 2005

  • February 2, 2010
  • 2 replies
  • 837 views

I'm trying to test for first letter capitalisation like so in ms sql 2005

SELECT [Id]
      ,[Code]
      ,[Country]
  FROM [[Currency]
 
  WHERE Country LIKE '[A-Z]%'

however I get everything back?

This topic has been closed for replies.
Correct answer Dan_Bracuk

where substring(country, 1, 1) between 'A' and 'Z'

2 replies

Dan_BracukCorrect answer
Inspiring
February 2, 2010

where substring(country, 1, 1) between 'A' and 'Z'

nikos101
nikos101Author
Inspiring
February 5, 2010

awesome

Dileep_NR
Inspiring
February 2, 2010

SELECT [Id]
      ,[Code]
      ,[Country]
  FROM [[Currency]
 
  WHERE Country REGEXP '^[A-Z]';

Also please refer

http://www.go4expert.com/forums/showthread.php?t=2337

nikos101
nikos101Author
Inspiring
February 2, 2010

thats mysql

Dileep_NR
Inspiring
February 2, 2010

ohhh.. Sorry

try this

http://sqltips.wordpress.com/2007/05/14/case-sensitive-string-comparison-in-sql-server-2005/