How can I take backup of particular tables in SQL Server 2008 using T-SQL Script

699    Asked by ChrisDyer in SQL Server , Asked on Sep 17, 2021

I want to take a backup of particular tables available in my database in a .bak file, and all these should be done using a T-SQL script.Backup Types are dependent on SQL Server Recovery Model. Every recovery model lets you back up whole or partial SQL Server database or individual files or filegroups of the database. Table-level backup cannot be created, there is no such option. But there is a workaround for this

Taking backup of SQL Server table possible in SQL Server. There are various alternative ways to backup a table in sql SQL Server

  • BCP (BULK COPY PROGRAM)
  • Generate Table Script with data
  • Make a copy of table using SELECT INTO
  • SAVE Table Data Directly in a Flat file
  • Export Data using SSIS to any destination
  • SQL server backup table using T-SQL script:

You can create a table script along with its data using the following steps:

  • Right click on the database.
  • Select Tasks > Generate scripts
  • Click next.
  • Click next.
  • In Table/View Options, set Script Data to True; then click next.
  • Select the Tables checkbox and click next.
  • Select your table name and click next.


Your Answer

Interviews

Parent Categories