SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 change from implicit join to explicit join
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

anjali5
Posting Yak Master

108 Posts

Posted - 01/03/2014 :  16:48:05  Show Profile  Reply with Quote
Hi All,

I am trying to convert from implicit joins to explicit join. Below is the quey that I need to change



update history
	set C.nha_name_abbr = S.name_abbr ,
	    C.nha_pn_mk_mod = S.pn_mk_mod,
	    C.nha_sn        = S.sn,
	    C.nha_mfr_lot	= S.mfr_lot,
		C.nha_dup_flag  = S.dup_flag
from history C, MEDS.dbo.status S
where C.nha_key_id_no *= S.key_id_no
  
  and C.nha_key_id_no > 0
  and process_userid = @entry_userid



after I changed it, I have the query below



update history
	set C.nha_name_abbr = S.name_abbr ,
	    C.nha_pn_mk_mod = S.pn_mk_mod,
	    C.nha_sn        = S.sn,
	    C.nha_mfr_lot	= S.mfr_lot,
		C.nha_dup_flag  = S.dup_flag
from history C  LEFT OUTER JOIN MEDS.dbo.status S
  ON (C.nha_key_id_no = S.key_id_no)
where 
  and C.nha_key_id_no > 0
  and process_userid = @entry_userid


when I put those changes, I am getting an error saying
The multi-part identifier "C.nha_name_abbr" could not be bound.

I am not sure what am I doing wrong.

tkizer
Almighty SQL Goddess

USA
36565 Posts

Posted - 01/03/2014 :  16:55:33  Show Profile  Visit tkizer's Homepage  Reply with Quote

update C
set 
    nha_name_abbr = S.name_abbr ,
    nha_pn_mk_mod = S.pn_mk_mod,
    nha_sn        = S.sn,
    nha_mfr_lot	= S.mfr_lot,
    nha_dup_flag  = S.dup_flag
from history C  
LEFT JOIN MEDS.dbo.status S
  ON C.nha_key_id_no = S.key_id_no
where 
  C.nha_key_id_no > 0
  and process_userid = @entry_userid


Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

anjali5
Posting Yak Master

108 Posts

Posted - 01/03/2014 :  17:04:10  Show Profile  Reply with Quote
Thanks.
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36565 Posts

Posted - 01/03/2014 :  17:05:01  Show Profile  Visit tkizer's Homepage  Reply with Quote


Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000