Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 777
  • Last Modified:

ASP/Access Table to Table Copy...

When a new "site" is created in our database, I'd like it to create a new status database from the template.  

I have a table that is a template for other tables to be created.  It is blank but is completely set up as far as field sizes, column names, primary keys, data types, etc.  Is there a way to effectively "clone" this table under a different name?

For example, if the new site is 6721, I'd like it to make a table called "istatus6721" using the format of "tpl_istatus".

Database is MSACCESS (Not my choice, I swear) and web interface is ASP.

Thoughts?

Joe
0
Joe Jenkins
Asked:
Joe Jenkins
  • 2
1 Solution
 
Devil666Commented:
hi there,

the following SQL should help you

SELECT tpl_istatus.* into istatus6721
FROM tpl_istatus;

hth
0
 
joeposter649Commented:
You could just use DDL to create the new table.
There are tools such as AQT that will create the DDL for existing tables.
0
 
Joe JenkinsAuthor Commented:
The SQL code above worked nicely with ASP.

I considered AQT for this as it would be a fantastic tool getting exact copies of tables BUT requiring each of our sites to purchase a license just to copy tables would be a waste of company resources.  The tables that are being copied are just simple collections of data and not too high on the importance meter but are necessary for the program to run correctly.  

Thanks again for the input.

Joe
0
 
joeposter649Commented:
Oh, sorry.
I thought you wanted to "make the table" not copy the data into one that's already created.

BTW, I use AQT a lot because I'm working with so many different databases... db2, sql server, sybase and access.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now