Results 1 to 7 of 7

Thread: I searched this but couldn't get a definitive

  1. #1

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015

    I searched this but couldn't get a definitive

    answer. I need a relatively quick, painless SQL statement for taking selecting * data from * tables in a DB, and placing all the data into another DB, which is already configured exactly as the one it's coming from. Same table names, same field names, same data types. So my question is, do I have to do select * and then insert value statements for each table? Or is there some group dump command I'm not aware of?

    Also, in VB6, how do I get the entire record of table A, into the insert statement for table B? Do I place the rs.Recordset into a variable? Thanks much in advance, for any help.

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    The sticky post at the top for sql statements..

    Code:
    Insert Into <tablename> ( <field>,<field>,<etc> )
    Select [Tablename].[fieldname],[tablename].[fieldname],[etc].[etc]
    From [tablename]
    Run one for each table.
    Use VBA code to loop through tables to automatically copy... Note Auto fields may change values...


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015
    Thanks. I guess there's no tidier way to do it. I was hoping I could just select *, then somehow concatenate the recordset, or place it's entire string in variable, and into the insert statement. Of if there was a command that dumped all tables , that would've been best.

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Originally posted by mendhak
    A small web-based (aspx?) or java-based chatroom, linked to from vbforums, so you log in with your own username+password, would be a good idea.

    It'll be just like chit chat at a faster speed.
    And just as bizzaar
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015
    Something tells me that post wasn't intended for this thread.

  6. #6
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    That is spooky ... it was meant for this thread:

    http://www.vbforums.com/showthread.p...77#post1802775

    Indeeed I pressed the reply button on that thread, havn't seen this one until now, so how the reply got here is a mystery.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  7. #7

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015
    Well you know what they say, "Bit Happens".

Posting Permissions

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



Click Here to Expand Forum to Full Width