Solved

ASP/Access Table to Table Copy...

Posted on 2006-07-13
4
752 Views
Last Modified: 2012-06-21
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
Comment
Question by:Joe Jenkins
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
Devil666 earned 250 total points
Comment Utility
hi there,

the following SQL should help you

SELECT tpl_istatus.* into istatus6721
FROM tpl_istatus;

hth
0
 
LVL 15

Expert Comment

by:joeposter649
Comment Utility
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
 
LVL 5

Author Comment

by:Joe Jenkins
Comment Utility
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
 
LVL 15

Expert Comment

by:joeposter649
Comment Utility
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

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now