Thursday, 15 November 2018

How can I take backup of particular tables in SQL Server 2008?

Process:

SELECT * INTO new_table_1
FROM existing_table_1
 
--- For table 2

SELECT * INTO new_table_2 
 FROM existing_table_2
 
and so on... for n number of tables

This statement WILL CREATE the tables called new_table_1, new_table_2 ,.. thus you do not have to previously create it.

Note: This process takes the backup quite fast but major disadvantage would be that it does not carry over the Keys, Indexes and Constraints of the table and backup is stored within the database not somewhere externally to a file.