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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL that works for Oracle (7.3) SQL Server AND MS Access

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-12-13 : 11:25:14
Jean writes "I am working on a website that will be ported between various servers and databases. The structure of the database doesn't change when moved from Access ('97) to Oracle (7.3) to SQL Server (6.5), but in the past I have had to rewrite the SQL statements each time we used a new database - particuarly those statements with left & right joins. Is there a way to write these joins so they work with all the major databases?

For example:

The Oracle code:
SELECT *
FROM table1
WHERE (table1.ID=1)
AND (table2.Language=1)
AND table1.ID (+) = table2.Item

The Access/SQL Server code:
SELECT *
FROM table1 LEFT JOIN table2 ON table1.ID = table2.Item
WHERE (table1.ID=1)
AND (table2.Language=2);

Thanks!

Jean"
   

- Advertisement -