Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Access generate CREATE TABLE script code like SQL Server can?

I have a MS Access file containing hundred of tables, I should create these tables using C# at runtime. So I should generate a script and use that query inside C# to create the tables. Is there a way that MS Access can generate this SQL script automatically?

Best regards

like image 632
Ehsan Akbar Avatar asked Sep 30 '22 08:09

Ehsan Akbar


1 Answers

No, Access itself cannot automatically create DDL (CREATE TABLE ...) code like SQL Server can. It is entirely possible that some third-party product might be able to scan through an Access database and write DDL statements for each table, but recommendations for such a third-party product would be off-topic on Stack Overflow.

Also, as mentioned in the comments to the question, creating an empty database file and then creating each table "from scratch" via DDL is not really necessary for an Access database. Since an Access database is just a file you can distribute your application with a database file that already contains the empty tables (and other database objects as required).

like image 86
Gord Thompson Avatar answered Oct 12 '22 01:10

Gord Thompson