ORACLE Converting An Oracle Query To MS SQL

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Converting an Oracle query to an SQL Server query can be a bit tricky as there are

some syntax differences between the two platforms.


However, the basic structure of a query is similar in both Oracle and SQL Server.
Here are some general guidelines that you can follow to convert an Oracle query to
an SQL Server query:

Use double quotes (") instead of single quotes (') to enclose string literals.
Replace the Oracle-specific functions with SQL Server equivalents.
For example, use the CONCAT function instead of the CONCATENATE operator (||).

Use the TOP keyword to limit the number of rows returned,


instead of the Oracle-specific ROWNUM keyword.

Use the CONVERT function to convert data types,


instead of the Oracle-specific TO_DATE, TO_CHAR, and TO_NUMBER functions.

Replace the Oracle-specific JOIN syntax with the standard SQL JOIN syntax.
Replace the Oracle-specific sequence object with the SQL Server equivalent.
Use square brackets [] instead of double quotes to enclose object names.
These are just general guidelines,
and the specific changes required will depend on the specific query being
converted.

You might also like