Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

error reporting in MS SQL 6.5

Posted on 1998-07-28
1
Medium Priority
?
197 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 150 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

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

810 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