SQL Server Performance

VERY URGENT: Shift data in cells

Discussion in 'Getting Started' started by ShikhaKaul, Apr 7, 2008.

  1. ShikhaKaul New Member

    Have one query...
    G3100A 11L

    if i have data like above in my table in one of the columns and i want it to change it to :

    G3100A 11L

    Shift places right ........

    IS it feasible if yes what is the query for that???

    Thanks a lot in advance
  2. Adriaan New Member

    "Shift places right ......."
    You must be playing musical chairs here.[;)]
    Sorry, your description is not terribly clear, and the problem does not appear to be horribly urgent.
  3. Greg Larsen New Member

    If you are just trying to insert 1 more space between those two strings in a single column you use the STUFF function like below. This code assumes there is at least one space in the column value between the two strings:create
    table x(col1 nvarchar(100));insert
    into x values ('ABC FGH');insert
    into x values ('ABCD GH') ;select
    stuff(col1,charindex(' ',col1),0,' ') from x ;drop
    table x;

Share This Page