Solved

ASP/Access Table to Table Copy...

Posted on 2006-07-13
4
754 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
ID: 17099030
hi there,

the following SQL should help you

SELECT tpl_istatus.* into istatus6721
FROM tpl_istatus;

hth
0
 
LVL 15

Expert Comment

by:joeposter649
ID: 17125388
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
ID: 17129228
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
ID: 17134358
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

832 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