Convert Mdb to Sql Server

后端 未结 2 1695
孤城傲影
孤城傲影 2021-01-26 09:14

How can i convert mdb access file to sql server using c# or other languages? I found an article in msdn. But, i couldnt understand.

Thanks.

相关标签:
2条回答
  • 2021-01-26 09:49

    Create your SQL Server database and then use Integration Services to transform the data. It makes sense to review the database design thoroughly before doing this. A design made for Jet won't necessarily be the best one for SQL Server.

    EDIT: I failed to mention one other significant difference. Jet/ACE enforces nullable foreign keys when a null is inserted, whereas SQL Server follows the SQL standard which requires that nulls are ignored in foreign key constraints (the constraint isn't violated). If you have nullable foreign keys then I highly recommend you redesign so that you can make them non-nullable in SQL Server (by moving the column(s) to a new table for example).

    0 讨论(0)
  • 2021-01-26 10:15

    this is not at all something you could do with C# ( unless you really want to read the schema of access tables and create similar schema in SQL Server using ADO.NET commands ).

    if your operation has to be done once only, it's much much easier you open SQL Management Studio, create an empty database and then right click on it, Tasks and "Import Data", then from the wizard you can select Import from MS Access and SQL Server will import structure and data.

    This answer is not valid in case you really want to write tons of code in C# to "mimic" what the mentioned wizard does and have a generic tool to use with different databases...

    0 讨论(0)
提交回复
热议问题