Create database from SQL script or multiple tables with SQL script

teachman

Active Member
Joined
Aug 31, 2011
Messages
321
First off, I am an Access newbie. I have a DDL SQL query script that creates many different tables in a database. But, all I can find is a make table query that only works one table at a time.

So, my first question is how do a create a database's tables from one DDL SQL script?

Second question is there a way to use the DDL SQL to create a database and all its tables in one step?

I could create the database using ACCESS methods. Then I would want to create all the tables at once.

I am much better at Excel, mostly because the help I've received over the years from the very helpful folks in the Excel Forum of MrExcel.com. I'm hoping to get some of the same kind of help here.

Thanks,

George Teachman
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
First off, I am an Access newbie. I have a DDL SQL query script that creates many different tables in a database. But, all I can find is a make table query that only works one table at a time.
I'm not sure what you mean. You are saying that you have a script that creates many tables (so far so good). But then all you can find is a make table query to works on one table at at time? What does that mean?
 
Upvote 0
Sorry for the lack of clarity. In the create tab in ACCESS a user can create table(s) using the interface and make that process into a MAKE TABLE Query. So, that the query can be run directly as an SQL script. But, I haven't been able to get that process to create more than one table at a time.

Does this make it more clear?

Thanks,

George Teachman
 
Upvote 0
You can write a script (?) that runs all your make table scripts, basically. If that's what you want. A make-table query is not technically the same as a create table script. Generally in Access people do not use scripts to create tables (it's more of a gui-driven platform than a script-driven platform).

Not sure what your use-case scenario is. Also possibly is to have a temp table available for use rather than having users creating new tables.
 
Last edited:
Upvote 0
I have a DDL SQL script created by another SQL database (My SQL Server) and I'd like to see what it looks like in Access.

Thanks,

George Teachman
 
Upvote 0
I have a DDL SQL script created by another SQL database (My SQL Server) and I'd like to see what it looks like in Access.

Specifically, a MySQLServer script as-is will almost certain to be incompatible with MSAccess. In general, as I said, you won't see scripts for MSAccess databases very often although it is possible to do with ADO or DAO vba scripts, and to some extent with Access DDL scripts (although Access DDL doesn't have the fine granularity that you would see in other database DDL languages).

In addition to the above link, you can see here for examples of using DAO for creating tables:
http://allenbrowne.com/func-DAO.html
http://www.functionx.com/vbaccess2013/table/dao/create.htm

and here for ADO:
http://allenbrowne.com/func-ADO.html
http://www.mahipalreddy.com/vb/article86695.htm

And here for plain DDL:
https://docs.microsoft.com/en-us/of...e/create-table-statement-microsoft-access-sql

But for example with Access you cannot click a button to generate a script for your entire database, as you can do in MySQL. Or even for any individual tables.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top