copy table from sql server 2005 one db to another

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hamayun Khan
    New Member
    • Aug 2007
    • 106

    copy table from sql server 2005 one db to another

    hi
    Is it possible to copy single table from one sql server db to another db. I have two copies of same database. I deleted data from table from origional table. now i want to copy the table from other copy of the database. I cannot complete overwrite the original database because there are a lot of new data and i have no backup. Its urgent.
    Any help. Thanks in advance
  • jvskarthick
    New Member
    • Nov 2006
    • 13

    #2
    For Example:

    1) Server Name as - SERVER1
    2) DB Name - DB1
    3) Backup Copy name - DB1.bak (taken the backup before deleting the table1)
    4) Consider U have delited the table1 from DB1 database

    Step 1:
    Restore the copy of the DB in to the same server with Different DB name.
    Exam)
    Restore the DB1.bak with DB2 (database name)

    Step 2:
    USE DB1
    GO
    SELECT * INTO table1 FROM DB2.dbo.table1
    GO

    Just use the above given steps and use your server name, DB name, table name. You can achive what u want.

    Finaly DROP the DB2 database if not required.

    Thanks,
    - Karthick

    Comment

    Working...