Script of the day - Remove White Space from a String
OK - this might be stretching the "Is this Useful" question a bit, but hey, I needed it today and thought I would share it with you - it's free! This construct takes the whitespace out of a string.
/*
usc_DBA_Remove_White_Space.sql
Removes extra white spaces between two words in a character string
*/
DECLARE
@TEXT VARCHAR(100)
DECLARE
@I INT
SET
@TEXT = 'Buck Woody'
SET
@I = CHARINDEX (' ' , @TEXT )
PRINT
SUBSTRING(@TEXT,1,@i-1) + ' ' +
LTRIM
(SUBSTRING(@TEXT,@I,len(@TEXT)))