.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
LVL 6
MohitPanditAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vitor MontalvãoMSSQL Senior EngineerCommented:
Use ANSI-SQL that will guarantee that any SQL will run in Oracle and SQL Server.
Or since you're developing with .NET, I think you can use LINQ to write common code that will work with SQL Server and Oracle.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Éric MoreauSenior .Net ConsultantCommented:
Unless your app is trivial and really simple and you are not using any special functions in Oracle, there is no magic.

Even tools like Entity Framework needs to generate 2 models.
0
Pawan KumarDatabase ExpertCommented:
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?

I will go with the two entity models. Oracle and SQL Server(t-sql) syntaxes are very different specially the update statement.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Vitor MontalvãoMSSQL Senior EngineerCommented:
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.
0
Pawan KumarDatabase ExpertCommented:
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

0
Vitor MontalvãoMSSQL Senior EngineerCommented:
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
0
Pawan KumarDatabase ExpertCommented:
Yes thats what. The one one is so used to SQL Server syntax will face issues like me :)
0
MohitPanditAuthor Commented:
Thanks for your comments & suggestions. I'll get back.
0
MohitPanditAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.