2
votes

I have some PHP applications running on Sybase ASE 15.0.2, and I need to port them to MicroSoft SQL Server 2008 R2. Many of the queries use the Sybase-only syntax with *= and =* Is there an automatic way to convert a query from the Sybase syntax to the standard syntax using LEFT/RIGHT OUTER JOIN ?

2
Please refer to this link to help you: - jainvikram444
I really mean automatic. I know how to do it manually, but the queries are many and complex. - carlo.borreo

2 Answers

3
votes

*= indicates a left outer join

=* indicates a right outer join

so

select * 
from tableA, titleauthor
where tableA.ID *= titleauthor.ID 

means

select * 
from tableA left join titleauthor
on tableA.ID = titleauthor.ID 

I dont think you will find a tool to do it automatically for you. Even though is simple, it can get tricky and an automated process wouldnt be 100% reliable (I think)

0
votes

For future conversion issues experienced by others (we're going from SAP ASE 16.0 to SQL Server 2016) simply select the query in SSMS, execute CTRL+SHIFT+Q to open the query designer. This will convert to SQL Server ANSI standard where possible.