SHARE
Facebook X Pinterest WhatsApp

Append File Script

Aug 2, 2002


This simple script from Ramunas Balukonis is useful when you need to log in to a file from SQL server. The script opens a file and adds user-specified information to that file.

Usage: dbo.append_log (@file_name VARCHAR(255) /* file2appaned*/, @msg VARCHAR(8000) /* msg2log */)

You need to set permission on master..OACreate, master..OADestroy, master..GetErrorInfo, master..sp_OAMethod xps to user, wich will execute this sp. Also you need to set write permissions on file @file_name, to the account under which SQL Server is running. Also, the “Scripting.FileSystemObject” object should be installed on the server.

Download the Script

Recommended for you...

What Backups Do I Have?
Gregory Larsen
May 12, 2021
Improving the Performance of a Table Variable using Optimizer Hint RECOMPILE
Gregory Larsen
Apr 1, 2021
TYPE Definition Change in Oracle 21c
Tip 74 – Changing Cost Threshold for Parallelism
Gregory Larsen
Feb 24, 2021
Database Journal Logo

DatabaseJournal.com publishes relevant, up-to-date and pragmatic articles on the use of database hardware and management tools and serves as a forum for professional knowledge about proprietary, open source and cloud-based databases--foundational technology for all IT systems. We publish insightful articles about new products, best practices and trends; readers help each other out on various database questions and problems. Database management systems (DBMS) and database security processes are also key areas of focus at DatabaseJournal.com.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.