Thanks Andy,
This format worked the best for me. I didn't realize we could use FROM in the UPDATE command. Here is my actual syntax that worked. (I originally gave a sample of code with not actual tables/fields)

UPDATE [crmprice].[dbo].[Person] SET Pers_EmailAddress = E.Emai_EmailAddress
FROM [crmprice].[dbo].[Person] P, [crmprice].[dbo].[Email] E
WHERE P.Pers_PersonID = E.Emai_PersonID
AND E.Emai_Type = 'Private' AND (P.Pers_EmailAddress IS NULL)

Philip


Andy Davies wrote:

I *always* have problems with these on SQL Server - but bol to the rescue:

try:

UPDATE persons
   SET DefEAddres=em.EAddress
   FROM persons p, EmailAdd em
   WHERE p.PersonId = em.PersonId
   AND em.Type = 'PRIVATE'

n.b. NOT p.DefEAddres

Andrew Davies  MBCS CITP
 - AndyD        8-)#


**********************************************************************

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error please notify the system manager.

This footnote also confirms that this email message has been swept by 
MIMEsweeper for the presence of computer viruses.

Please contact [EMAIL PROTECTED] with any queries.

**********************************************************************



[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to