Re: substring update?
From: Uri Dimant (urid_at_iscar.co.il)
Date: 03/24/05
- Next message: Simon Hayes: "Re: Error 15401 adding login to SQL Server"
- Previous message: Mike Epprecht (SQL MVP): "RE: encrypt sensitive data"
- In reply to: marcmc: "substring update?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 24 Mar 2005 11:23:12 +0200
Hi
DECLARE @Var VARCHAR(30)
SET @Var='UK AB10'
SELECT REPLACE(@Var,'UK'+SPACE(1),'GED')
"marcmc" <marcmc@discussions.microsoft.com> wrote in message
news:FCDDC9E0-DC99-4A90-8A4B-D55975236012@microsoft.com...
> I have...
>
> Po_rd_postcode_id
> -----------------
> UK AB10 2 spaces between UK and AB10
>
> I want to update it to...
>
> Po_rd_postcode_id
> -----------------
> GED AB10 1 space between GED and AB10
>
> I was hoping to use...
>
> Update POt_lu_rd_post_code
> set substring(Po_rd_postcode_id,1,4) = 'GED '
> WHERE Po_rd_postcode_id = 'UK AB10'
>
> But it looks like substring in the set criteria won't work.
> Any ideas how I can do this?
>
>
>
- Next message: Simon Hayes: "Re: Error 15401 adding login to SQL Server"
- Previous message: Mike Epprecht (SQL MVP): "RE: encrypt sensitive data"
- In reply to: marcmc: "substring update?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|