Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jayram11
Yak Posting Veteran
97 Posts |
Posted - 2010-10-21 : 11:42:17
|
| Hi i get an error for the following sproc. Any help in rectifying thisUpdate Bset B.ASC_CHANGES = 2 from ASCG as Ainner join (select * from ASCG where asc_Eff_Start = '04/01/2008') as Bon A.ASC_HCPCS = B.ASC_HCPCSwhere A.asc_Eff_Start = '01/01/2008'and a.asc_base <> b.ASC_BASEand B.ASC_CHANGES is nulland b.asc_link is nullcreate procedure sp_ASCratechange@date1 varchar(10),@date2 varchar(10)asUpdate Bset B.ASC_CHANGES = 2 from ASCG as Ainner join (select * from ASCG where asc_Eff_Start = @date2) as Bon A.ASC_HCPCS = B.ASC_HCPCSwhere A.asc_Eff_Start = @date1and a.asc_base <> b.ASC_BASEand B.ASC_CHANGES is nulland b.asc_link is nullexecute sp_ASCratechange '01/01/2008', '04/01/2008'Msg 4421, Level 16, State 1, Procedure sp_ASCratechange, Line 5Derived table 'B' is not updatable because a column of the derived table is derived or constant. |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-10-21 : 12:01:56
|
Maybe thisUpdate B Aset B.ASC_CHANGES = 2 from ASCG as Ainner join (select * from ASCG where asc_Eff_Start = '04/01/2008') as Bon A.ASC_HCPCS = B.ASC_HCPCSwhere A.asc_Eff_Start = '01/01/2008'and a.asc_base <> b.ASC_BASEand B.ASC_CHANGES is nulland b.asc_link is null PBUH |
 |
|
|
jayram11
Yak Posting Veteran
97 Posts |
Posted - 2010-10-21 : 14:54:38
|
| i tried your method and it gives me this errorMsg 4104, Level 16, State 1, Line 1The multi-part identifier "B.ASC_CHANGES" could not be bound. |
 |
|
|
|
|
|