0

Looking to get a SQL database backup with a specific filter, like for a limited table, limited content and exclude some table(only content not schema)

Suppose I have a student database with only one table as details and having two column name and class, so here I want to database backup of only those student who has a name starts with S, like

select * from details where name like 'S%' , now get a database backup of this.

I have just taken a small example, actually, I have a database with thousands of table and million of records, the main problem what I am facing is I have a main database with 200 GB space and require only a limited data in other instance so I need to backup and restore the same. So I want only that backup which I require not the entire one.

Your help is really apricated and please do revert if I am not descriptive.

user513820
  • 11
  • 1
  • I'd say create a script to move it to a new database, then back that one up. – Jens Jul 10 '17 at 08:36
  • Sorry, but I can't perform this, as the database is quite huge (around 400 GB) and not having that space to move to the new database and then copy. Here I have to perform the filter .bak directly – user513820 Jul 10 '17 at 08:39
  • Are the target database and source database located into same server ? if Yes, There are several ways to do this. go to:- https://stackoverflow.com/questions/10028805/transfer-data-from-one-database-to-another-database – ahmed abdelqader Jul 10 '17 at 08:41
  • I think i am not clear here, i want the .bak(backup) file from a database which can be restored to any other SQL database. Here I can not create a new database, I need to create a .bak file with a filler content – user513820 Jul 10 '17 at 08:57
  • I think you can go as far as create scripts with your content, but creating a bak file which only contains a portion of the data you want based on an input query, without making a temporary database to hold that data in... I doubt if that's even possible. – Jens Jul 10 '17 at 09:27
  • FilLer or filTer? – Roger Wolf Jul 10 '17 at 11:22
  • filter, like to create the database backup file on the basis of a SQL querry – user513820 Jul 11 '17 at 08:31

0 Answers0