Solved

error reporting in MS SQL 6.5

Posted on 1998-07-28
1
178 Views
Last Modified: 2010-03-19
Please give me a hint how to store error tracking information out of stored procedures.

I don't like message boxes, cause the administrator is not always present at the server. Also, storing stuff in the standard log events isn't useful, because other people of the team fill these also.

I'd like some kind of TXT file at a fixed place that is automatically created when not present, and text is appended when it exists.

How can such a file be accessed out of a SP ?
0
Comment
Question by:PC-Alex
1 Comment
 
LVL 4

Accepted Solution

by:
mitek earned 50 total points
ID: 1089282
I would do something like this -- it will log a short message line to a pre-defined place completely independently from other logging that's taking place ...
The only thing, the user running the sp should be granted permissions to run master..xp_cmdshell

DECLARE @fname varchar(255),@message varchar(255)

SELECT @fname = 'C:\temp\sql.log'

SELECT @message = 'echo error message text' + ' >> ' + @fname

EXEC master..xp_cmdshell @message


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now