| Author |
Topic |
|
sprasad
Starting Member
2 Posts |
Posted - 2008-11-03 : 19:17:58
|
| Update EnvCVTPhase2.dbo.cseSet EnvCVTPhase2.dbo.cse.usr_db_id = Ref_Master.dbo.Usr_Align.Usr_db_IdSELECT EnvCVTPhase2.dbo.Cse.case_id, EnvCVTPhase2.dbo.Cse.physician_id, EnvCVTPhase2.dbo.Physician.state_id, Ref_Master.dbo.Usr_Align.Usr_db_IdFROM EnvCVTPhase2.dbo.Cse ,-- EnvCVTPhase2.dbo.Physician , Ref_Master.dbo.Usr_Align ON EnvCVTPhase2.dbo.Cse.physician_id = EnvCVTPhase2.dbo.Physician.physician_id AND EnvCVTPhase2.dbo.Cse.state_id = Ref_Master.dbo.Usr_Align.Align_ValueAND EnvCVTPhase2.dbo.Physician.state_id = Ref_Master.dbo.Usr_Align.Align_Value--order by Ref_Master.dbo.Usr_Align.Usr_db_IdI get the following error message Msg 156, Level 15, State 1, Line 9Incorrect syntax near the keyword 'ON'.What would the fix |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-03 : 23:48:41
|
or is it this?Update c Set c.usr_db_id = ua.Usr_db_IdFROM EnvCVTPhase2.dbo.Cse cJOIN EnvCVTPhase2.dbo.Physician pON c.physician_id = p.physician_id JOIN Ref_Master.dbo.Usr_Align uaON c.state_id = ua.Align_ValueAND p.state_id = ua.Align_Value |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2008-11-04 : 14:59:40
|
quote: Originally posted by sprasad Update EnvCVTPhase2.dbo.cseSet EnvCVTPhase2.dbo.cse.usr_db_id = Ref_Master.dbo.Usr_Align.Usr_db_IdSELECT EnvCVTPhase2.dbo.Cse.case_id, EnvCVTPhase2.dbo.Cse.physician_id, EnvCVTPhase2.dbo.Physician.state_id, Ref_Master.dbo.Usr_Align.Usr_db_IdFROM EnvCVTPhase2.dbo.Cse ,-- EnvCVTPhase2.dbo.Physician , Ref_Master.dbo.Usr_Align ON EnvCVTPhase2.dbo.Cse.physician_id = EnvCVTPhase2.dbo.Physician.physician_id AND EnvCVTPhase2.dbo.Cse.state_id = Ref_Master.dbo.Usr_Align.Align_ValueAND EnvCVTPhase2.dbo.Physician.state_id = Ref_Master.dbo.Usr_Align.Align_Value--order by Ref_Master.dbo.Usr_Align.Usr_db_IdI get the following error message Msg 156, Level 15, State 1, Line 9Incorrect syntax near the keyword 'ON'.What would the fix
sprasad, you mixed syntax styles. You either need your syntax to use FROM ... JOIN ... ON ... or it would use FROM ... , ... WHERE ... = ...You blended the ON without the JOIN and wihtout a WHERE.Tara's rewrite should work fine for you.---------------------------EmeraldCityDomains.com |
 |
|
|
tosscrosby
Aged Yak Warrior
676 Posts |
Posted - 2008-11-04 : 15:31:05
|
quote: Originally posted by tkizer How is that different from mine?Tara Kizer
Well, it did increase HIS posting count. I think I finally figured out his secret!! - JK (and by stating this bit of info, I increased mine as well - WooHoo!) Terry |
 |
|
|
sprasad
Starting Member
2 Posts |
Posted - 2008-11-05 : 14:22:40
|
| Tara, Appreciate your feebback --- did implementation on the code and in process of testing ...Thanks a bunch!!!!!!!!! |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-11-05 : 16:29:18
|
quote: Originally posted by tosscrosby
quote: Originally posted by tkizer How is that different from mine?Tara Kizer
Well, it did increase HIS posting count. I think I finally figured out his secret!! - JK (and by stating this bit of info, I increased mine as well - WooHoo!) Terry
What is the meaning of JK?Is it "just kidding"?Webfred No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
tosscrosby
Aged Yak Warrior
676 Posts |
Posted - 2008-11-05 : 16:54:40
|
[/quote]What is the meaning of JK?Is it "just kidding"?Webfred No, you're never too old to Yak'n'Roll if you're too young to die.[/quote]It is. I didn't want to offend visakh. I know he's a posting madman and 99.999999% are good/great examples of code. Just wanted to give him the business since he did post the same code as Tara.Terry |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-11-05 : 17:08:18
|
It is what I thought. But visa is not a posting madman - he (it) is a new kind of posting bot! Webfred No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Kobojunkie
Starting Member
8 Posts |
Posted - 2008-11-05 : 17:35:54
|
| Update EnvCVTPhase2.dbo.cse Set EnvCVTPhase2.dbo.cse.usr_db_id =Ref_Master.dbo.Usr_Align.Usr_db_Id from( SELECT EnvCVTPhase2.dbo.Cse.case_id, EnvCVTPhase2.dbo.Cse.physician_id, EnvCVTPhase2.dbo.Physician.state_id, Ref_Master.dbo.Usr_Align.Usr_db_Id FROM EnvCVTPhase2.dbo.Cse inner join EnvCVTPhase2.dbo.Physician ON EnvCVTPhase2.dbo.Cse.physician_id = EnvCVTPhase2.dbo.Physician.physician_id inner join Ref_Master.dbo.Usr_Align On EnvCVTPhase2.dbo.Cse.state_id = Ref_Master.dbo.Usr_Align.Align_Value AND EnvCVTPhase2.dbo.Physician.state_id = Ref_Master.dbo.Usr_Align.Align_Value--order by Ref_Master.dbo.Usr_Align.Usr_db_Id) |
 |
|
|
tosscrosby
Aged Yak Warrior
676 Posts |
Posted - 2008-11-06 : 08:11:38
|
quote: Originally posted by webfred he (it) is a new kind of posting bot! Webfred No, you're never too old to Yak'n'Roll if you're too young to die.
Agreed. Over 2K posts in what, the last 4 weeks?? He must eat, sleep and breath postings! Terry |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-06 : 09:07:48
|
quote: Originally posted by tosscrosby
What is the meaning of JK?Is it "just kidding"?Webfred No, you're never too old to Yak'n'Roll if you're too young to die.[/quote]It is. I didn't want to offend visakh. I know he's a posting madman and 99.999999% are good/great examples of code. Just wanted to give him the business since he did post the same code as Tara.Terry[/quote]Sorry that was not intentional. It seems like I didnt read Taras post clearly. Apologies. I think i need to read previous suggestions twice before posting from now on |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-06 : 09:22:26
|
quote: Originally posted by tosscrosby
quote: Originally posted by webfred he (it) is a new kind of posting bot! Webfred No, you're never too old to Yak'n'Roll if you're too young to die.
Agreed. Over 2K posts in what, the last 4 weeks?? He must eat, sleep and breath postings! Terry
Not exactly. But still takes serious amount of time |
 |
|
|
tosscrosby
Aged Yak Warrior
676 Posts |
Posted - 2008-11-06 : 09:26:48
|
[/quote]Sorry that was not intentional. It seems like I didnt read Taras post clearly. Apologies. I think i need to read previous suggestions twice before posting from now on [/quote]If anything, apologies should be mine. I was simply trying to inject a little humor and give you a hard time (I've seen 2 congrats on posting milestones for you in the past month so maybe a little jealousy on my part?? - naw, not my style). As webfred put it - "he (it) is a new kind of posting bot" - and I find it simply amazing. Keep up the good work.Terry |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-06 : 09:31:00
|
quote: Originally posted by tosscrosby
Sorry that was not intentional. It seems like I didnt read Taras post clearly. Apologies. I think i need to read previous suggestions twice before posting from now on [/quote]If anything, apologies should be mine. I was simply trying to inject a little humor and give you a hard time (I've seen 2 congrats on posting milestones for you in the past month so maybe a little jealousy on my part?? - naw, not my style). As webfred put it - "he (it) is a new kind of posting bot" - and I find it simply amazing. Keep up the good work.Terry[/quote]No problem Terry I felt bad as i myself hate duplicate suggestions. No worries. |
 |
|
|
|