-
Update from second table
I am trying to update the values of one table based on a second table where
the LogonNames are identical in both tables.
UPDATE memSecurity INNER JOIN tmptblSecurityImport ON memSecurity.LogonName
= tmptblSecurityImport.LogonName SET memSecurity.ExpDate =
tmptblSecurityImport.ExpDate;
Works in MSAccess but not in SQL7. What am I overlooking?
Paul Dionne
-
Re: Update from second table
Simple syntax problem here. In SQL, the SET clause comes before the JOINs
and you have to specify the tables in a FROM clause.
UPDATE memSecurity
SET ExpDate = tmptblSecurityImport.ExpDate
FROM memSecurity
INNER JOIN tmptblSecurityImport ON memSecurity.LogonName
= tmptblSecurityImport.LogonName
- Jason
"Paul Dionne" <P-IHATESPAM-Dionne@Kreative.net> wrote:
>I am trying to update the values of one table based on a second table where
>the LogonNames are identical in both tables.
>
>UPDATE memSecurity INNER JOIN tmptblSecurityImport ON memSecurity.LogonName
>= tmptblSecurityImport.LogonName SET memSecurity.ExpDate =
>tmptblSecurityImport.ExpDate;
>
>Works in MSAccess but not in SQL7. What am I overlooking?
>
>Paul Dionne
>
>
>
-
Re: Update from second table
Thanks, it worked
Jason Rein wrote in message <38df7bf2@news.devx.com>...
>
>Simple syntax problem here. In SQL, the SET clause comes before the JOINs
>and you have to specify the tables in a FROM clause.
>
>UPDATE memSecurity
>SET ExpDate = tmptblSecurityImport.ExpDate
>FROM memSecurity
>INNER JOIN tmptblSecurityImport ON memSecurity.LogonName
>= tmptblSecurityImport.LogonName
>
>- Jason
>
>"Paul Dionne" <P-IHATESPAM-Dionne@Kreative.net> wrote:
>>I am trying to update the values of one table based on a second table
where
>>the LogonNames are identical in both tables.
>>
>>UPDATE memSecurity INNER JOIN tmptblSecurityImport ON
memSecurity.LogonName
>>= tmptblSecurityImport.LogonName SET memSecurity.ExpDate =
>>tmptblSecurityImport.ExpDate;
>>
>>Works in MSAccess but not in SQL7. What am I overlooking?
>>
>>Paul Dionne
>>
>>
>>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks