Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Append to txt File using SQL Server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-07-19 : 07:05:41
Bhawesh Kumar writes "I m currently using BCP utilty to take backup of tables from sql server before deleting data from them. I need to change it to take backup monthly in the same file by appending to file.
Is there any process in sql server that can be implemented in stored procedure to append to txt file (monthly backup). If yes please provide me. If no please provide me with other options to take backup using sql server stored procedures"

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-07-19 : 13:59:29
I don't understand why you aren't using BACKUP DATABASE to backup the database. But anyway, bcp the data out to a file, then use DOS type command to append them together. You can do this via xp_cmdshell within a stored procedure.

The beelow command will concatenate all files found in the Temp directory into a new file.
C:\Temp>type *.* > C:\SomeNewFile.Txt

Tara
Go to Top of Page
   

- Advertisement -