Skip to content

Instantly share code, notes, and snippets.

@georgduees
Created March 20, 2015 13:10
Show Gist options
  • Save georgduees/add21f9cb7cf4cd09914 to your computer and use it in GitHub Desktop.
Save georgduees/add21f9cb7cf4cd09914 to your computer and use it in GitHub Desktop.
Check if string has content, and Return Trimmed, else return NULL
--Detect if string has leading or trailing whitespaces, if so trim them and return else return null,
SELECT ISNULL(NULLIF(LTRIM(RTRIM(' teststring ')), ''),NULL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment