Using CFML to Backup (duplicate) tables into the same orSecond MDB

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Using CFML to Backup (duplicate) tables into the same orSecond MDB

    I need help with some CF code that will target the users tables with in the DB
    and make copies of them, I think the best idea is to copy them into a seperate
    DB. I have a master DB that services MANY different customers, all have tables
    with the same name, but each table includes their "name" as part of the table
    name (ei, SMITHemail, and JONESemail are the same format and my templates get
    data from the correct table based on the "name" part).

    Part of my control panel is (hoping to) give the admin power to BACK-UP their
    tables before they make changes to their data, or RESTORE from previous
    back-ups if they screw up. I need to be able to do this on a table by table
    basis. I have used CF to back-up/copy entire DB's before but never isolated
    tables. I have a set list of about 12 tables (per client) and would like to
    present the user with the ability to back-up/restore any/all of their tables.

    bigbrain28 Guest

  2. Similar Questions and Discussions

    1. Accessing duplicate field names from different tables
      Hi, I am joining two tables, and the two tables have the same field names, but they represent different data. eg. table 1 - People name -...
    2. MySQL backup but only soem tables with a prefix
      One of my friend had to mix 2 kind of tables into the same database 'friend_database' using a different prefix (pre1_tables and pre2_tables ). He...
    3. CFML from MSSQL
      I am attempting to pull CFML, <cfoutput>'s, etc. from a database and have them inserted into a .cfm page and executed at runtime. Instead of the...
    4. use cfml in JS
      Hi Is it possible to use ColdFusion functions in Javacript ? e.g. (won't work) <script language="JavaScript" type="text/javascript"> <!--...
    5. loop - begin backup, end backup Oracle 8.1.7
      Hello, we have the problem named after: last weekend (22.12.2002), we did a reorganisation of a tablespace with the tool "sapdba" from SAP....
  3. #2

    Default Re: Using CFML to Backup (duplicate) tables into thesame or Second MDB

    For the record, there are probably more efficient ways to accomplish your goal,
    but, if this is what you want to do,

    Make sure the databases can select from each other.

    Then write your queries something like this: note that you are backing up db1
    into db2


    delete from db2.tablename

    insert into db2.tablename
    select * from db1.tablename


    Dan Bracuk Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139