SQLSoldier

Detect Middle Spaces

Aug 29th, 2016
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.30 KB | None | 0 0
  1. Declare @T Table (Test varchar(100));
  2.  
  3. Insert Into @T
  4.  
  5. Select Test
  6. From @T
  7. Where SubString(Test, CharIndex('; ', Test) + 1, CharIndex(' [email protected]', Test,  CharIndex('; ', Test)) - CharIndex('; ', Test)) Not Like '^[ ]';
Advertisement
Add Comment
Please, Sign In to add comment