Wednesday, October 31, 2012

Table Backup with native SQL, Process 1


-- Table Backup with native SQL, Process 1
Version : SQL 2008 R2 or later.

Table Backup.
You can get the result in 4 types...
 Process 1 : Generating scripts
 Process 2 : Import/Export Option (T-SQL/SSIS)
 Process 3 : Inserting into new table (Select * into newtab from baktab)
 Process 4 : Inserting into existing table (Create newtable with same structure as
Original table, Insert into newtable select * from backtab)

You have an option with Generating Scripts by limiting the data, means It may not support for large tables...Sometimes it depends on your RAM.
See below how it works..

Step (i) :
Right click on the database -> Tasks -> Generate Scripts
                          Fig  : DBRightClick
Step (ii) :

Select Choose Objects tab and click on Select specific database object
Expand tables and check the table which you would like to take the backup and click next button.

                             Fig : GenerateScritps1
Step (iii) :
 Now you have quite a few options to save the table backup.
 a) Save to a file by locating the file in valid location.
 b) Save to clipboard
 c) Save to new query window.

                               Fig : GenerateScritps2
 So, here most importantly after selecting one of the above you have to click the
 advanced button on top right corner of the selection.
 (Note : This part will be the first in step(ii) in sql 2005 and 2008)
 It will let you see the new window 'Advanced Scripting Options'
 You have to Scroll down and look for the option 'Type of the data to script'
 Please select Schema and Data from the Drop down.

Step (iv) :
Click ok to close this Advanced window and Click next and Finish buttons to close
 the process.

No comments:

Post a Comment