开发者

Has anyone converted an existing .NET application with SQL Server backend to work with Oracle

开发者 https://www.devze.com 2022-12-19 01:36 出处:网络
I am looking to modify a .NET application that has a SQL Server backend to make it work with Oracle. Has anyone done this? Any pitfalls th开发者_Python百科at I can avoid?It really depends on how you a

I am looking to modify a .NET application that has a SQL Server backend to make it work with Oracle. Has anyone done this? Any pitfalls th开发者_Python百科at I can avoid?


It really depends on how you are accessing the database, and how much of your code is database-specific.

If you are using Linq to SQL, you will have to migrate to a different ORM, as Linq to SQL only supports SQL Server.

If you are using stored procedures or DDL statements, you may have to rewrite substantial portions of these to get them to work in Oracle.

If your SQL statements are all ANSI SQL compliant, and you are using ADO.NET to access the database, all you may need to do is change the connection strings.

Some of the datatypes have different names in Oracle.

Using Entity Framework might reduce some of the pain points; since EF supports multiple database providers, it should abstract away much of the compatibility pain.

Generally speaking, Oracle requires more expertise, maintenance and tuning than SQL Server. Having a DBA can really be beneficial.


One of the big differences you'll find, other than the list from @Robert Harvey, is generating primary keys: SQLServer has autoincrement, which you'll have to do yourself in oracle (at least, up to Oracle 10 - I'm not familiar with 11). Typically, you'll have to use a sequence; for consistency you can create on insert triggers, or just use the sequence.nextval in your insert statement.

0

精彩评论

暂无评论...
验证码 换一张
取 消