RE: Update Query with Inner join

RE: Update Query with Inner join

 

  

try

UPDATE CaveatsData
SET CaveatsData.Title = CavTitle.Title
FROM CavTitle, CaveatsData
where CavTitle.RecId = CaveatsData.RecId




Regards

Partha Mandayam
Software Consultant
Home page: http://partha.tripod.com






>From: "Carter Phillip "
><mssqldba-ezmlmshield-x22240290.[Email address protected]
>To: "LazyDBA Discussion" <[Email address protected]
>Subject: RE: Update Query with Inner join
>Date: Fri, 30 Jul 2004 12:17:30 +1000
>Received: from www.websitesondatabases.com ([216.55.183.38]) by
>mc9-f34.hotmail.com with Microsoft SMTPSVC(5.0.2195.6824); Thu, 29 Jul 2004
>19:18:01 -0700
>Received: (qmail 32298 invoked by uid 121); 30 Jul 2004 02:17:04 -0000
>Received: (qmail 28355 invoked from network); 30 Jul 2004 2:17:4 -0000
>X-Message-Info: JGTYoYF78jH92g+kdbY6yO/We6SKyEzS
>Mailing-List: contact mssqldba-[Email address protected] run by ezmlm
>Precedence: bulk
>X-No-Archive: yes
>List-Post: <mailto:[Email address protected]
>List-Help: <mailto:mssqldba-[Email address protected]
>List-Unsubscribe: <mailto:mssqldba-[Email address protected]
>List-Subscribe: <mailto:mssqldba-[Email address protected]
>Delivered-To: mailing list [Email address protected]
>Message-ID: <20040730021704.32296.[Email address protected]
>Return-Path: mssqldba-return-7388-MCP111=hotmail.[Email address protected]
>X-OriginalArrivalTime: 30 Jul 2004 02:18:01.0267 (UTC)
>FILETIME=[70205030:01C475DB]
>
>Syntax looks ok. Are you trying to run this in Enterprise Manager??
>
>If so, try using Query Analyzer instead. It's not as helpful when building
>queries, but it handles all the T-SQL syntax variations.
>
>
>Thanks
>Phillip Carter
>Ph: +61 3 9235 1691
>
>
>-----Original Message-----
>From: Renga [mailto:mssqldba-ezmlmshield-x97616294.[Email address
>protected]
>Sent: Friday, 30 July 2004 11:39 AM
>To: LazyDBA Discussion
>Subject: Update Query with Inner join
>
>
>Hi,
>
>CavTitle
>========
>RecID Title
>------ ------------
>1 FreeHold-99
>2 FreeHold-999
>3 Lease-50
>
>CaveatsData
>============
>RecID Title OTHERFIELDS
>------ ------ -----------
>1 <NULL> SOME DATAS
>2 <NULL> SOME DATAS
>3 <NULL> SOME DATAS
>
>UPDATE CaveatsData SET CaveatsData.Title = CavTitle.Title
> FROM CavTitle INNER JOIN CaveatsData
> ON CavTitle.RecId = CaveatsData.RecId
>
>I have two tables having RecId for relationship, Want to fill the
>CaveatsData.Title when I run the aboce query, result is correct but SQL
>server displays an error message.
>
>"The Query Designer does not support the Optional FROM clause SQL
>construct."
>
>what the right syntax ? pls..
>
>warm rgds,
>P.Renga
>
>
>
>
>---------------------------------------------------------------------
>TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Website :
>http://www.LazyDBA.com To unsubscribe:
>http://www.lazydba.com/unsubscribe.html
>For additional commands, e-mail: mssqldba-[Email address protected]
>
>
>IMPORTANT DISCLAIMER - THIS MAY AFFECT YOUR LEGAL RIGHTS:
>
>Because this document has been prepared without consideration of any
>specific clients investment objectives, financial situation or needs,
>a Bell Potter Securities Limited investment adviser should be
>consulted before any investment decision is made.
>
>While this document is based on the information from sources which
>are considered reliable, Bell Potter Securities Limited, its directors,
>employees and consultants do not represent, warrant or guarantee,
>expressly or impliedly, that the information contained in this document
>is complete or accurate.
>
>Nor does Bell Potter Securities Limited accept any responsibility to
>inform you of any matter that subsequently comes to its notice, which
>may affect any of the information contained in this document.
>
>This document is a private communication to clients and is not intended
>for public circulation or for the use of any third party, without the
>prior approval of Bell Potter Securities.
>
>
>Disclosure of Interest: Bell Potter Securities Limited receives commission
>from dealing in securities and its authorised representatives, or
>introducers
>of business, may directly share in this commission. Bell Potter Securities
>and its associates may hold shares in the companies recommended.
>
>Bell Potter Securities Limited ABN 25 006 390 772 AFS Licence No. 243480
>
>
>---------------------------------------------------------------------
>TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
>Website : http://www.LazyDBA.com
>To unsubscribe: http://www.lazydba.com/unsubscribe.html
>For additional commands, e-mail: mssqldba-[Email address protected]
>



MS Sql Server LazyDBA home page