Re: [NF] SQL Server commands

2006-08-16 Thread Ailsom F. Heringer (Osklen)
Like this ? UPDATE Persons SET DefEAddres=EmailAdd.EAddress WHERE Persons.PersonId = EmailAdd AND EmailAdd.Type = 'PRIVATE' -- Aílsom F. Heringer [EMAIL PROTECTED] Skype: ailsom.osklen Analista de Sistemas -- Osklen Departamento de Informática Rio de Janeiro - RJ

Re: [NF] SQL Server commands

2006-08-16 Thread Ted Roche
On 8/16/06, Philip B [EMAIL PROTECTED] wrote: What would be the equivalent in SQL Server syntax to do the following: *--- SELECT 0 USE Persons SELECT 0 USE EmailAdd ORDER PersonID SET FILTER TO type = PRIVATE IN EmailAdd SELECT

Re: [NF] SQL Server commands

2006-08-16 Thread Andy Davies
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-)#

RE: [NF] SQL Server commands

2006-08-16 Thread stephen . russell
From: Andy Davies [EMAIL PROTECTED] 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

RE: [NF] SQL Server commands

2006-08-16 Thread David Stevenson
Stephen, Andy, you should create the join instead of putting its clause in the where. Is that just personal preference or is there a technical reason for doing so? I'm not taking sides either way -- just curious about your reason for saying he SHOULD create the join. David Stevenson -- No

Re: [NF] SQL Server commands

2006-08-16 Thread Philip B
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