0

I am working on a project with multi users who can store their individual data. I am confused on how to proceed if a user wants to save his own data from multiple tables as a backup and retrieve it any time if the data is lost or corrupted if anyone has any clue on how to do that would be a great help.

1

1 Answer 1

0

You cannot backup specific tables to a .bak file, but you can export them to a CSV or script them out. What you can do if you want to back up specific tables is move them into a separate file group and back up that file group.

See Back Up Files and Filegroups for the documentation.

Below is an example.

--Back up the files in SalesGroup1.
BACKUP DATABASE Sales
   FILEGROUP = 'SalesGroup1',
   FILEGROUP = 'SalesGroup2'
   TO DISK = 'C:\MySQLServer\Backups\Sales\SalesFiles.bak';
GO
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.