>From memory I think for MSSQL you should use a format like:

UPDATE a
SET Department = b.Department
FROM SHDayD a, Product b
WHERE a.ScanCode = b.ScanCode

HTH

Stephen

-----Original Message-----
From: David Brennan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 2 October 2001 10:41 a.m.
To: Multiple recipients of list delphi
Subject: Re: [DUG]: Update SQL Syntax

> What is the syntax for an update query if I want to reference another
table
> ?
>
> I.E
>
> UPDATE SHDayD
> SET Department = Product.Department
> WHERE (ScanCode = Product.ScanCode)
>
Depends a bit on which version of SQL you are using but the following would
work on SQL Server:

UPDATE SHDayD
SET Department = Product.Department
FROM Product
WHERE (SHDayD.ScanCode = Product.ScanCode)

David.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to