Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 table restore

Author  Topic 

flagstaffroy
Starting Member

2 Posts

Posted - 2007-01-03 : 23:33:23
How do I restore a table from *.bak file?
While at the subject how do I copy data from one table to another within same database?

any help appreciated?

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-03 : 23:48:17
I don't think you can restore single table from the backup. You have to restore entire backup.

To copy data from one table to another, do either of the following:

1.
Create Table dest
(
col1...,
col2...
)

Insert into dest(col1, col2, ...)
select col1, col2, ...


2.

Select * into dest
from sourcetbl
where 1=0

Insert into dest(col1, col2, ...)
select col1, col2, ...



Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-01-04 : 02:30:24
"How do I restore a table from *.bak file?"

You will have to restore the BAK to a new, temporary, database; "copy" the table from the temporary database to the "live" database; then drop the temporary database.

Kristen
Go to Top of Page
   

- Advertisement -