Skip to content

Instantly share code, notes, and snippets.

@osya
Last active August 29, 2015 14:11
Show Gist options
  • Save osya/2271b319f6df764a66bd to your computer and use it in GitHub Desktop.
Save osya/2271b319f6df764a66bd to your computer and use it in GitHub Desktop.
Replace white spaces with empty characters #SQL
--Tab, line feed and carriage return control characters have the values CHAR(9), CHAR(10) and CHAR(13) respectively.
cast(REPLACE(REPLACE(REPLACE(your_number_column,CHAR(9),”), CHAR(10),”),CHAR(13),”) as bigint)
http://bisherryli.com/2014/05/30/sql-54casting-numbers-with-white-spaces-as-integer-will-fail/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment