Solved

convert .ddl file to an access db file?

Posted on 2004-08-21
13
903 Views
Last Modified: 2012-05-05
how to convert .ddl file to an access db file? what tool to use?
0
Comment
Question by:she1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
13 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11858850
a file with the extension .DDL is a file which contains Data Definition Language (CREATE TABLE... etc).

The best you could do would be to EXECUTE that DDL, to create that tables, though this may not be completely possible, since Access amy or may not support the Data Types specified in the .ddl file.  The best you can do is to open the .ddl file with Notepad, and look at the commands that you find.

AW
0
 

Author Comment

by:she1
ID: 11858968
yes , i can open the file with notepad and see these command,
but is there a tool run these command to creat the table?
0
 
LVL 17

Expert Comment

by:BillAn1
ID: 11858985
You can simply paste them into a query (one at a time!) in Access
However, as Arthur Wood points out, they may not work in Access, if the data types are wrong, or if there is any sophisticated DDL, such as creating indexes, constraints etc. a lot of DDL is database-specific.
0
Webinar: Security & Encryption in the MySQL world

Join Percona’s Solutions Engineer, Dimitri Vanoverbeke as he presents “Security and Encryption in the MySQL world” on Thursday, July 6, 2017 at 7:00 am PDT / 10:00 am EDT (UTC-7).

 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11859552
can you paste the DDL from the file, so we can look at it, and then be better able to advise you as to what to do next?

AW
0
 

Author Comment

by:she1
ID: 11862502
DROP TABLE AutoStock;

CREATE TABLE AutoStock (make varchar(25), model varchar(25), year integer,
  color varchar(25), mileage integer, price float(10),
  vin integer PRIMARY KEY);

INSERT INTO AutoStock VALUES (
'Porsche', '911', 2001, 'Black', 25, 90000, 123456
);

INSERT INTO AutoStock VALUES (
'Ferrari', 'Maranello', 2001, 'Red', 15, 200000, 24601
);

INSERT INTO AutoStock VALUES (
'Lamborghini', 'Diablo', 2001, 'Yellow', 20, 275000, 80386
);

INSERT INTO AutoStock VALUES (
'Audi', 'TT', 2001, 'Gray', 25, 40000, 5000
);
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11864036
this is clearly DDL for Microsoft SQL Server, and there are some siginificant differences between the datatype is Access and SQL Server (Access does not support varchar text fields, and Access Integers are not exactly that same type as SQL Server Integers - An SQL INTEGER field is more correctly an Access LONG INTEGER Access also does not support the SQL Server datatype 'float')

Also, this contains both DDL (CREATE TABLE ...) and DML (Data Management Language - INSERT INTO...) statements, and these would need to executed SEPARATELY in Access.  Access can only execute ONE SQL statement per file, not a block such as this.


There is no DIRECT way to convert the SQL Server DDL file to the equivalent Access cvommands - there is no single program that can do this, short of executing the DDL file into SQL Server (creating the table and importing the data), and then exporting the SQL Server table as a Access table (using SQL Server DTS - Data Transformation Service), or Linking Access to the SQL Server table, and importing the data into an equivalent Access Table.

AW
0
 

Author Comment

by:she1
ID: 11864075
thanks , is it possible to "importing the data into an equivalent Access Table." directly?
"
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11865197
if you use SQL Server DTS, then you can export from SQL Server directly to a table in your Access database, if that is what you mean.


But that DDL is so simple, why don't you simply create the same table in Access (Table/New)???

AW
0
 

Author Comment

by:she1
ID: 11866513
but later on, I have a more complicated DB, and i want to convert it again, what can i do?
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 30 total points
ID: 11869718
your best approach would appear to the to execute the DDL in SQL Server, and then export the tables to Access.  As I said, there is no direct way to execute the SQL Server DDL in Access, as the datatypes are too differennt, and the SQL Server DDL incluudes MULTIPLE sets of commands, and Access can only execute one command per instruction set.

AW
0
 

Author Comment

by:she1
ID: 11876686
actually the database is cloudscape. my i just run the command in access?
or i have to run it at sql server?
0
 

Author Comment

by:she1
ID: 11960221
actually , it might be the cloudscape DB. i am not sure it is or not?
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11962440
I doubt that it is Cloudscape, as CloudScape appears to be an object-relational database management system (ORDBMS).  And I doubt that IBM would use the same command architecture as MicroSoft ( and the DataTYpes specified in the DDL are definitely SQL Server DataTypes).

AS I indicated on 8/23 - process the DDL in SQL Server, and then import the tables into Access, and you should be set to go.

AW
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question