|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
SQL Logs. Which One and How?
I have a resulting stored procedure from running this text in Query Analyser.
<CODE> create procedure xx_temp2 as begin print 'xx_temp2' Raiserror('xx_temp2 error message', -1, -1) with log return 0 end grant execute on xx_temp2 to readers grant execute on xx_temp2 to writers </CODE> I subsequently call the stored procedure via exec xx_temp2 in Query Analyser again expecting it to write to 'the' log. I'm running SQL 2000 SP4 and my questions are: 1) Which log is this going to write to? (Transaction??) 2) How do I find and open the log. (Properties of the database and thus Program files??) 3) Once I have the log how do I open it and find my entry easily? (SELECT * ...?????) Apologies for this but I have tried a few things and I'm unsure of whether this stored procedure actually writes to a log and if it does. how to find the relevant entries? For the record I have tried <CODE> DBCC log (DBName) </CODE> and brought back some entries. If this is correct I'm not sure how to find my entries if they are there. Thanks for any help. Phil.
__________________
- Post your code - Post your errors - Be clear - Be courteous PLEASE...Finalise your thread with a solution or confirmation that the last advice worked or failed (We are here to help each other).
|
|
#2
|
||||
|
||||
|
WITH LOG writes to the NT EVENT LOG on the server. Not sure if it writes to the trans log.
|
|
#3
|
||||
|
||||
|
Quote:
OK. Thanks for this. I'll check this when I get back in work tomorrow. Does anyone know how to write to the Transaction log and if there are ever permissions set to restrict writing to the transaction log? Are there any other logs on an SQL server that a stored procedure could possibly write to? The reason I ask is that I have received an Access violation or syntax error for yet another encrypted stored procedure. I think it might be something to do with either SP4 for SQL 2000 not being installed correctly, MDAC not being at the latest level or just an error with config. Needless to say this is a client site and we are investigating. I know there are lots of questions here and I know this is quite vague. I apologise for that but there's not too much more I know I'm afraid. Thanks to anyone that can add more information to this. Phil. |
|
#4
|
|||
|
|||
|
Have you looked in books online? The whys and wherefores of the transaction log are pretty well documented.
I think you need a third-party program to actually view the transaction log, or manipulate it other than using it to restore a db after a failure. Again, books online should tell you.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#5
|
||||
|
||||
|
It writes to the NT event log. I just tried it...
|
|
#6
|
||||
|
||||
|
Thanks boys. I'll look again in a few hour when I'm at work and I'll be sure to check the Event Log.
Appreciated. Phil. |
|
#7
|
||||
|
||||
|
This is very strange as when I run exec xx_temp2 in Query Analyser this does not write to the event log. That is, eventvwr for Windows XP.
Are you sure about this? |
|
#8
|
||||
|
||||
|
I think I've found the log I wanted.
Expand Server group Expand Management Expand SQL Server Logs Select Current (Date and time) |
|
#9
|
||||
|
||||
|
Apologies for cross posting but I've had no joy at DevShed and I thought I would come back to this post. They are connected.
Has anyone got any comments they can add to these posts as I've spent so much time on this and any ideas could spark something off for me. Thanks in advance. Phil (Losing hair by the second )EDIT: Link would be useful I guess! Doh! To DevShed Post Last edited by PhilCollins99 : July 19th, 2005 at 01:19 PM. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > SQL Logs. Which One and How? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|