Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesI have one field organization_operati ng_name that is on two tables vendor an d vendor_loc I want to update the vendor name to the vendor_loc name I tried this but get errors... update vendor_loc set organization_operati ng_name = vendor. organization_operati ng_name where organization_operati ng_name like 'DO NOT%' Server: Msg 107, Level 16, State 3, Line 1 The column prefix 'vendor' does not match with a table name or alias name used in the query. vendor is a valid table name...so I must be missing something. jeff -- Message posted via http://www.webservertalk.com
Post Follow-up to this messageSee Example C under UPDATE in Books Online, and also "Changing Data Using the FROM Clause". Simon
Post Follow-up to this messagethanks Simon, the lightbulb went off.... Simon Hayes wrote: >See Example C under UPDATE in Books Online, and also "Changing Data >Using the FROM Clause". > >Simon -- Message posted via http://www.webservertalk.com
Post Follow-up to this messageUPDATE Vendor_Loc SET organization_operati ng_name = (SELECT organization_operati ng_name FROM Vendors WHERE organization_operati ng_name LIKE 'DO NOT%'); You would never use the proprietary UPDATE .. FROM syntax because the results are unpredictable. It will fail to discover cardinality violations, does not port, and depends on the physical arrangment of the data. .
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread