Skip to content

Instantly share code, notes, and snippets.

@wellercs
Created July 27, 2012 23:07
Show Gist options
  • Save wellercs/3190937 to your computer and use it in GitHub Desktop.
Save wellercs/3190937 to your computer and use it in GitHub Desktop.
Searching on first character with CHARINDEX
DECLARE @AlphaNumChars varchar(50)
SET @AlphaNumChars = 'a,1,m,s'
SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE CHARINDEX(LEFT(TABLE_NAME,1),@AlphaNumChars) > 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment