Solved

error reporting in MS SQL 6.5

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

747 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

10 Experts available now in Live!

Get 1:1 Help Now