Results 1 to 3 of 3
  1. #1
    Join Date
    May 2008
    Posts
    16

    Exclamation Unanswered: Migrate data from one table to another without giving column names

    Hi,

    I have two databases, I need to move the data from Table A of Database1 to Table B of Database2.
    Schema of Table B in Database2 can be same as of Table A or it can contain few more columns which have default values specified.
    I need to do it without specifying the columns names of any of the tables.
    Is there any way to do it?

    Thanks,
    Onkar

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by Onkar
    Is there any way to do it?
    nope, not if the receiving table has extra columns
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Yes, if the matching column names always match, or the ordinals always match. But it involves building dynamic SQL from the system tables. Yurgh.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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