Solved

error reporting in MS SQL 6.5

Posted on 1998-07-28
1
188 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

830 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