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 |
rjhe22
Constraint Violating Yak Guru
283 Posts |
Posted - 2012-10-24 : 06:58:41
|
hi i have this query UPDATE ACRT SET Yourcolumn = CASE WHEN ACRT.NEGWATCH = 1 THEN x.IRBRATING ELSE IRBT.IRBRATING ENDFROM ACRTINNER JOIN IRBT ON IRBT.MOODYSRATE = ACRT.MOODYSRATECROSS APPLY ( SELECT i.IRBRATING FROM IRBT i WHERE i.ID = IRBT.ID +1) x it works the way i want it on sql server buti get error when i run it in sybaseerrors are[DATADIRECT][ODBC SYBASE WIRE PROTOCOL DRIVER][SQL SERVER]INCORRECT SYNTAX NEAR 'CROSS'.[DATADIRECT][ODBC SYBASE WIRE PROTOCOL DRIVER][SQL SERVER]INCORRECT SYNTAX NEAR 'X'.does anyone now how i can get this working |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-10-24 : 07:03:02
|
I don't have sybase, and don't know much about it, but I suspect it is the cross apply that is causing the problem. If so you can try this:UPDATE ACRT SET Yourcolumn = CASE WHEN ACRT.NEGWATCH = 1 THEN x.IRBRATING ELSE r.IRBRATING ENDFROM ACRTINNER JOIN IRBT r ON r.MOODYSRATE = ACRT.MOODYSRATEINNER JOIN IRBT x ON x.ID = r.ID +1 |
|
|
rjhe22
Constraint Violating Yak Guru
283 Posts |
Posted - 2012-10-24 : 07:06:41
|
think that did the jobthanks |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-10-24 : 07:35:18
|
You are welcome! |
|
|
|
|
|