quote:
Originally posted by vijays3
quote:
Originally posted by visakh16
UPDATE [qoemetrics].[dbo].[User]
SET URI=CAST([UserKey] AS varchar(5))+ 'abc.com'
WHERE URI LIKE '%sip:[a-z]%'
------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
Hi visakh
your query eliminate the sip string .
create table #temp(UserKey int,URI varchar(30))
insert into #temp(UserKey,URI)
select 1,'sip:userA@abc.com'
union all
select 2,'sip:+4412345678@abc.com'
union all
select 3,'sip:userC@abc.com'
update #temp set URI = 'sip:'+ cast(UserKey as varchar(20))+'@abc.com'
where URI like 'sip:[a-z][A-Z]%'
select * from #temp
Vijay is here to learn something from you guys.