Thanks for reply, I a need to make backup data from a query. I think about this:
BACKUP DATABASE 'sourceDB'
Select * from Table1 where Day = '20.07.2015';
TO DISK = 'F:\Program Files\Microsoft SQL Server\MSSQL\Backup\sourceDB.bak' WITH FORMAT
I would suggest next. If you have access to Management Studio, you can save query results to a file quite easily: 1.Open a query window. One way to do this is by right-clicking on the database name in the Object Explorer. 2.You might want to write the query and run it there first, to test that it is producing the desired results. 3.When you are ready to run the query and save it to file, on the menu choose Query, then Results To, and finally Results to File. 4.Now, when you run the query (F5), you will get a dialog box to indicate the filename and folder to save the data. You can find more details, if you need sqlbak.com/blog/backup-query-results/ That's all there is to it.