Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Test for first letter capitalisation like so in ms sql 2005

Enthusiast ,
Feb 02, 2010 Feb 02, 2010

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?

TOPICS
Database access
714
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 02, 2010 Feb 02, 2010

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

Translate
Contributor ,
Feb 02, 2010 Feb 02, 2010

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

Also please refer

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 02, 2010 Feb 02, 2010

thats mysql

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 02, 2010 Feb 02, 2010

ohhh.. Sorry

try this

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 02, 2010 Feb 02, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 05, 2010 Feb 05, 2010
LATEST

awesome

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources