SQL SERVER SPACES WITHIN A STRING

Jeet Verma

Total Post:110

Points:776
Posted by  Jeet Verma
 875  View(s)
Ratings:
Rate this:

I need to add spaces within a string.

Original String: up70aert55
Expected Result: up 70 aert 55
  1. Takeshi Okada

    Post:89

    Points:629
    Re: SQL Server Spaces within a string

    can achieve this with LEFTSUBSTRINGRIGHT functions.


    SELECT LEFT('up70aert55',2)+' '+
    SUBSTRING('up70aert55',3,2)+' '+
    SUBSTRING('up70aert55',5,4)+' '+
    RIGHT('up70aert55
    ',2);

      Modified On Nov-06-2014 06:27:07 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!