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.
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).
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...
精彩评论