Backup a database table

Discussion in 'ASP General' started by peashoe, Mar 26, 2007.

  1. peashoe

    peashoe Guest

    I need to be able to add a button on my site that will backup an SQL
    table (not the whole database) - does anyone know how to do that?

    Thanks in advance
    Lisa
    peashoe, Mar 26, 2007
    #1
    1. Advertising

  2. peashoe

    Evertjan. Guest

    Jon Paal [MSMD] wrote on 28 mrt 2007 in
    microsoft.public.inetserver.asp.general:

    >> is this the wrong way to do this??

    >
    > You should respond to "peashoe"


    [Please do not toppost on usenet]

    This is usenet, so one responds to the group, Jon. ;-)

    >> strSQL = "select [field names] into [backup table name] from [table
    >> name]" conn.execute (strSQL)
    >>
    >> then you can just have a link or a form button that goes to that
    >> page??
    >>
    >> if you plan on making a regular backup, you would have to have
    >>
    >> strSQL = "drop table [backup name]"
    >> conn.execute (strSQL)


    I think, though I did not test, this is a very nice way to do it.

    Perhaps having a small pile of backups could be even safer:


    strSQL = "drop table [backup3]"
    conn.execute strSQL
    strSQL = "select * into [backup3] from [backup2]"
    conn.execute strSQL
    strSQL = "drop table [backup2]"
    conn.execute strSQL
    strSQL = "select * into [backup2] from [backup1]"
    conn.execute strSQL
    strSQL = "drop table [backup1]"
    conn.execute strSQL
    strSQL = "select * into [backup1] from [table]"
    conn.execute strSQL

    or perhaps more efficient, work with a ring of backup tables and a
    'mostRecentBackup' pointer in a seperate small table that could also
    accomodate the datetime of each backup.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Mar 28, 2007
    #2
    1. Advertising

  3. peashoe

    Evertjan. Guest

    Jon Paal [MSMD] wrote on 28 mrt 2007 in
    microsoft.public.inetserver.asp.general:

    > This group has been top posting since I can remember (many years). I
    > prefer top posting.


    Are you responding to something, Jon? Quoting is there for a reason.

    And this group has not been topposting in a majority of the posts for as
    far as I can remember.

    > Top posting prevents having to scroll down through a hundred lines of
    > history


    No it does not. It only would if senseless topposting would be the only
    alternative senseless bottomposting, but the sensible alternative pointed
    to in Netiquette is sparce interposting, not senseless bottomposting.

    > to see a final closing comment and since this is a
    > threaded discussion it makes good since to top post.


    I hope you mean sense?

    No it does not on usenet, Jon, since the nature of usenet prevents the
    certainty that the post you are replying on is already on the local news
    server, or is stil on the same. Netiquette is there for a reason also in
    this case.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Mar 28, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VisionSet

    Re: backup database

    VisionSet, Aug 30, 2003, in forum: Java
    Replies:
    0
    Views:
    368
    VisionSet
    Aug 30, 2003
  2. bhagat
    Replies:
    4
    Views:
    7,733
    steve
    Oct 5, 2005
  3. gavino
    Replies:
    13
    Views:
    1,037
  4. Acm
    Replies:
    1
    Views:
    696
  5. Replies:
    0
    Views:
    576
Loading...

Share This Page