Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DoubleBrotherProgrammer/733857 to your computer and use it in GitHub Desktop.
Save DoubleBrotherProgrammer/733857 to your computer and use it in GitHub Desktop.
How to find all database tables whose names end in an UPPERCASE X, using tsql
-- Give me all tables ending with an UPPERCASE X
SELECT table_name, SUBSTRING( table_name, LEN(table_name), 1 ) as 'end'
FROM INFORMATION_SCHEMA.TABLES
-- SELECT ascii('X') = 88
-- SELECT ascii('x') = 120
WHERE ASCII( SUBSTRING( table_name, LEN(table_name), 1 ) ) = 88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment