Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Posts
    8

    Unanswered: Split contents of Column

    Hi

    I have imported some data into my sql database (Sql server 2005) but then realised that names have gone in as one string. Is there a way I can split this on uppercase letter for instance

    AndrewJames - Andrew James

    Thanks in advance for any help given

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Please run this. If any rows are returned, tell us what you want doing with them.
    Code:
    SELECT    the_name
    FROM   myTable
    WHERE    the_name LIKE '%[A-Z]%[A-Z]%[A-Z]%' COLLATE Latin1_General_BIN
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Mar 2009
    Posts
    8
    Thanks for the reply, I used the following as I needed a quick fix

    Code:
    SELECT     ADMINISTRATOR
    --UPDATE CONTACT
    --SET ADMINISTRATOR = 'Vicky Sidwell'
    FROM         CONTACT
    --WHERE ADMINISTRATOR = 'VickySidwell'
    WHERE     (ADMINISTRATOR <> '') AND (ADMINISTRATOR <> 'Dr Blackwell') AND (ADMINISTRATOR <> 'Nandy Richards') AND (ADMINISTRATOR <> 'Calvin Gudu') AND (ADMINISTRATOR <> 'Jane Andrews') AND (ADMINISTRATOR <> 'Clare Stone') 
    AND (ADMINISTRATOR <> 'Dave Spinner') AND (ADMINISTRATOR <> 'Fiona Colegrave') AND (ADMINISTRATOR <> 'Hannah Lawman') AND (ADMINISTRATOR <> 'Jenny Booth') AND (ADMINISTRATOR <> 'Linda Simpson') AND (ADMINISTRATOR <> 'Ross Taylor')
    AND (ADMINISTRATOR <> 'Vicky Sidwell')
    ORDER BY ADMINISTRATOR
    Removing comments each time and then updating the second where statement when I changed a name

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    If there are that few I think this might be one of the few times I'd recommend just opening up the table in Management Studio and directly editing the data.


    Urggghhhh - I feel dirty
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •