
SQL Code Generation Script to generate ANSI SQL tables
1. Use Shlaer Mellor Methodology with arrow heads for 1:1, 1:M, and M:M
2. Create a class with all SQL data types, e.g. name CHAR, age NUM to update wc2.ini
3. Enter attribute size and constraints, e.g. (10)NOT_NULL in -ATTRIBUTE_USER1 text box
4. Check Index Box for all attributes that are a key or index
5. Enter index keywords, e.g. UNIQUE CLUSTERED in ATTRIBUTE_USER2
6. Select "Generate - Generate Class Report" and select SQL1.SCT script
for normal SQL or SQLSTORE.SCT for SQL Server code generation with stored procedures.
7. Please send script improvements to MicroGold 71543.1172@compuserve.com 
   info Richard Felsinger 71162.755@compuserve.com


SQL Code Generation Script to generate SQL tables for import into Microsoft Access

1. Use Shlaer Mellor Methodology with arrow heads for 1:1, 1:M, and M:M

2. Create a class with all SQL data types, e.g. name TEXT, age LONG to update wc2.ini

3. Enter attribute size e.g. (10)NOT_NULL in ATTRIBUTE_USER1 text box

4. Check Index Box for all attributes that are a key or index

5. Enter index keywords, e.g. UNIQUE or PRIMARY KEY in ATTRIBUTE_USER2.  The keyword
FOREIGN KEY does not compile in Microsoft Access.  

6. Select "Generate - Generate Class Report", enter a file name, e.g SQLRPT.TXT and 
select SQLACCES.SCT script.  This script assumes you will have at least one index,
e.g. PRIMARY KEY.  If you don't have an index, you will have to delete the last
comma.

7. Select "File Edit File" to open SQLRPT.TXT

8. Select and copy all the SQL statements for a single table 

9. In Microsoft Access, select Query New, then SQL or SQL - Data Definition, then paste 
the SQL statements for a single table, then Save.  If necessary correct any syntax errors. 

10. In Microsoft Access, select Query Open to create the table

11. Repeat the cut and paste for all tables.  

Problems: 1) Access 2.0 does not let you create multiple tables in one 
query.  2) I have not been able to create a foreign key using SQL.
The following SQL statement may be modified to create a foreign key:
CONSTRAINT customerFK REFERENCES Customer,

Please send script improvements to MicroGold 71543.1172@compuserve.com 
   info Richard Felsinger 71162.755@compuserve.com  803-881-3648



