Access: get the row of the creation table

I have a table in access and I would like to get a SQL string from it that will generate the table, for example:

CREATE TABLE example (
         id INT,
         data VARCHAR(100)
       );

      

is there a way to do this?

+2


a source to share


5 answers


More or less as you have:

CREATE TABLE example (
         id INT,
         data text(100)
       );

      



You might want to check the DAO data types: http://allenbrowne.com/ser-49.html

-1


a source


I don't believe there is a built-in way. You will need to use a third party tool to convert the circuit:



To run VB Script to convert tables, here: Create DDL Table from Microsoft Access

+4


a source


If you're talking about a generic method that will work on any Access table, I don't know how to get the SQL CREATE statement directly. I suspect that there are too many features in Access (dropdown values ​​for fields, input masks, etc.) that do not transition well to SQL.

Access has the ability to export the table directly to SQL Server. You can try to push the table on SQL Server and then generate a CREATE statement.

+2


a source


If you are trying to port this to SQL server or the like, I think you will have to create scripts manually.

You can always use the SQL Server Import Wizard (or Export to SQL from Access) to move it and then create scripts on the SQL Server.

Don't forget that you can get SQL Express for free to do things.

+1


a source


Can I export tables to XML / XSD? This is not DDL, but you have a schema in a file that you can import using other tools.

+1


a source







All Articles