Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | 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
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

anjali5
Posting Yak Master

121 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
38200 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

121 Posts

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

tkizer
Almighty SQL Goddess

USA
38200 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  
 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.07 seconds. Powered By: Snitz Forums 2000