• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

complex update query

My attached select query works fine

But I need to update CALLDETAIL.dbo.inboundVoiceMail.existsCRM to True
where portal.dbo.FormatPhoneNumber2(sourceNumber) = p.name
Select 	portal.dbo.FormatPhoneNumber2(sourceNumber) sourceNumber, p.name 
	from CALLDETAIL.dbo.inboundVoiceMail
	left join (Select name from crmprod_01.dbo.phone_phones
				group by name) p
				on portal.dbo.FormatPhoneNumber2(sourceNumber) = p.name

Open in new window

0
lrbrister
Asked:
lrbrister
1 Solution
 
AnujCommented:
UPDATE CALLDETAIL.dbo.inboundVoiceMail
SET CALLDETAIL.dbo.inboundVoiceMail.existsCRM = 1
from CALLDETAIL.dbo.inboundVoiceMail
left join (Select name from crmprod_01.dbo.phone_phones
            group by name) p
            on portal.dbo.FormatPhoneNumber2(sourceNumber) = p.name
0
 
sachinpatil10dCommented:
try this

update CALLDETAIL.dbo.inboundVoiceMail 
	set CALLDETAIL.dbo.inboundVoiceMail.existsCRM = 'True'
	from CALLDETAIL.dbo.inboundVoiceMail
	left join (Select name from crmprod_01.dbo.phone_phones
				group by name) p
				on portal.dbo.FormatPhoneNumber2(sourceNumber) = p.name

Open in new window

0
 
lrbristerAuthor Commented:
WOrked with the exception of changing the left join to a join
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now