Hi
This article is based on bcp (Bulk Copy Processing). BCP utility is generally used to transfer large data into own file format.
For More Details you can visit : http://msdn.microsoft.com/en-us/library/ms162802.aspx
This utility is useful to archiving log which is older then 30 days and It will dump all records to the file. If bcp commands run successfully then only delete command will execute and delete all the archiving records from database.
I have created Stored Procedure for Log Archiving. Please find list of advantage of Log Archive Script:
- Run "SQLInsertScriptForBCP.sql" for Creating Dummy Table for BCP.
- User can pass Table Name, No of Days Older, Path and File Name as parameter
- While Archive log if any error is generated then it will log that error and Delete command will not be executed.
- Automatically retrieve server name.
- You can run this utility on schedule also.
-
That's it.
Pritesh Gandhi.
Reference links:
http://sqlfool.com/2008/12/bcp-basics/
No comments:
Post a Comment