Link to home
Start Free TrialLog in
Avatar of MohitPandit
MohitPanditFlag for India

asked on

.NET application to support Oracle & SQL Server

Hello Folks,

I need to build a .NET Application. Initially, it will support to Oracle and later with SQL Server.
So, once migrate with Oracle to SQL Server for data and db schema. It will be done by migration tool.

But, how about CRUD operation, which should common for Oracle and SQL Server?
Should I use plain sql and run time judge with SQL Server & Oracle client OR maintain two entity model?
Do you have any thoughts & suggestions?

Best Regards,
Mohit Sharma
ASKER CERTIFIED SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oracle and SQL Server(t-sql) syntaxes are very different specially the update statement.
Really? Do you have examples that states your affirmation? I can't see any difference besides the in-built functions that are specific for each SQL language.
Example-

This will not work in Oracle but works really well in SQL Server.

Update x
SET x.c1 = y.c1
FROM table1 x
INNER JOIN table2 y ON x.a = y.a

Open in new window

Well, that's not ANSI-SQL. In my comment I told that if the author uses ANSI-SQL it won't have issues.
For your example the following will work on both Oracle and SQL Server:
UPDATE table1
SET c1 = (SELECT y.c1
          FROM table2 y
          WHERE table1.a = y.a);

Open in new window


EDIT: Code updated
Yes thats what. The one one is so used to SQL Server syntax will face issues like me :)
Avatar of MohitPandit

ASKER

Thanks for your comments & suggestions. I'll get back.
Thanks