Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Detect Middle Spaces

SQLSoldier Aug 29th, 2016 90 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. Declare @T Table (Test varchar(100));
  2.  
  3. Insert Into @T
  4. Values ('me@me.com; test@email.com'),
  5.     ('me@me.com;  test@email.com');
  6.  
  7. Select Test
  8. From @T
  9. Where SubString(Test, CharIndex('; ', Test) + 1, CharIndex(' test@email.com', Test,  CharIndex('; ', Test)) - CharIndex('; ', Test)) Not Like '^[ ]';
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top