Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 18th, 2005, 01:17 PM
PhilCollins99's Avatar
PhilCollins99 PhilCollins99 is offline
The Constant Student
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Location: England
Posts: 914 PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 5 h 42 m 36 sec
Reputation Power: 28
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).

Reply With Quote
  #2  
Old July 18th, 2005, 02:14 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
WITH LOG writes to the NT EVENT LOG on the server. Not sure if it writes to the trans log.

Reply With Quote
  #3  
Old July 18th, 2005, 05:55 PM
PhilCollins99's Avatar
PhilCollins99 PhilCollins99 is offline
The Constant Student
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Location: England
Posts: 914 PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 5 h 42 m 36 sec
Reputation Power: 28
Quote:
Originally Posted by dcarva
WITH LOG writes to the NT EVENT LOG on the server. Not sure if it writes to the trans log.


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.

Reply With Quote
  #4  
Old July 18th, 2005, 06:19 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 9 m 23 sec
Reputation Power: 181
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

Reply With Quote
  #5  
Old July 18th, 2005, 08:13 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
It writes to the NT event log. I just tried it...

Reply With Quote
  #6  
Old July 19th, 2005, 01:32 AM
PhilCollins99's Avatar
PhilCollins99 PhilCollins99 is offline
The Constant Student
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Location: England
Posts: 914 PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 5 h 42 m 36 sec
Reputation Power: 28
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.

Reply With Quote
  #7  
Old July 19th, 2005, 05:05 AM
PhilCollins99's Avatar
PhilCollins99 PhilCollins99 is offline
The Constant Student
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Location: England
Posts: 914 PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 5 h 42 m 36 sec
Reputation Power: 28
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?

Reply With Quote
  #8  
Old July 19th, 2005, 05:59 AM
PhilCollins99's Avatar
PhilCollins99 PhilCollins99 is offline
The Constant Student
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Location: England
Posts: 914 PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 5 h 42 m 36 sec
Reputation Power: 28
I think I've found the log I wanted.

Expand Server group
Expand Management
Expand SQL Server Logs
Select Current (Date and time)

Reply With Quote
  #9  
Old July 19th, 2005, 01:09 PM
PhilCollins99's Avatar
PhilCollins99 PhilCollins99 is offline
The Constant Student
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Location: England
Posts: 914 PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 5 h 42 m 36 sec
Reputation Power: 28
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > SQL Logs. Which One and How?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT