Read Error Log In Sql Server 2000
Contents |
(Русский)ישראל (עברית)المملكة العربية السعودية (العربية)ไทย (ไทย)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語) HomeLibraryLearnDownloadsTroubleshootingCommunityForums Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: exec sp_readerrorlog 0,1,'inconsistency' for SQL 2000 SQL Server > SQL Server Database sql server xp_readerrorlog Engine Question 0 Sign in to vote when I run exec sp_readerrorlog
Xp_readerrorlog Sql 2014
0,1,'inconsistency' for SQL 2005, it shows only records having 'inconsistency' word, but run for SQL 2000, it returns all
Sp_readerrorlog In Sql Server 2012
logs, any idea? 2011-06-22 23:25:15.76 server Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) 0 May 3 2005 23:18:38 0 Copyright (c) 1988-2003 Microsoft Corporation 0 Enterprise Edition on Windows NT
Sp_readerrorlog Filter By Date
5.2 (Build 3790: Service Pack 2) 02011-06-22 23:25:15.76 server Copyright (C) 1988-2002 Microsoft Corporation. 02011-06-22 23:25:15.76 server All rights reserved. 02011-06-22 23:25:15.76 server Server Process ID is 1592. 02011-06-22 23:25:15.76 server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL\log\ERRORLOG'. 02011-06-22 23:25:15.81 server SQL Server is starting at priority class 'normal'(2 CPUs detected). 02011-06-22 23:25:15.92 server SQL Server configured for thread mode sp_readerrorlog msdn processing. 02011-06-22 23:25:15.93 server Using dynamic lock allocation. [2500] Lock Blocks, [5000] Lock Owner Blocks. 02011-06-22 23:25:16.09 server Attempting to initialize Distributed Transaction Coordinator. 0 Tuesday, July 26, 2011 4:10 PM Reply | Quote Answers 0 Sign in to vote Hi George, SQL Server offers an undocumented system stored procedure sp_readerrorlog which allows you to read the contents of the SQL Server error log files directly from a query window and also allows you to search for certain keywords when reading the error file. Below is the sample of sp_readerrorlog ,you will see that when this gets called it calls an extended stored procedure xp_readerrorlog CREATE PROC [sys].[sp_readerrorlog]( @p1 INT = 0, @p2 INT = NULL, @p3 VARCHAR(255) = NULL, @p4 VARCHAR(255) = NULL) AS BEGIN IF (NOT IS_SRVROLEMEMBER(N'securityadmin') = 1) BEGIN RAISERROR(15003,-1,-1, N'securityadmin') RETURN (1) END IF (@p2 IS NULL) EXEC sys.xp_readerrorlog @p1 ELSE EXEC sys.xp_readerrorlog @p1,@p2,@p3,@p4 END In SQL Server 2005, this procedure takes four parameters: 1.Value of error log file you want to read: 0 = current, 1 = Archive #1, 2 = Archive #2, etc... 2.Log file type: 1 or NULL = err
My favorites My picture album Shortcut keys My code library VB resources xp_readerrorlog 2014 SQLServer resources SQLServer books Replication FAQ Scripting resources ASP resources Search xp_readerrorlog all logs my site Sign my guestbook Contact information SQL Server Articles New NEW!!! Subscribe to my newsletter: xp_readerrorlog permissions Want to keep in touch with the latest in SQL Server world? Email vyaskn@hotmail.com with 'subscribe' in the subject line See also: Database programming https://social.msdn.microsoft.com/Forums/sqlserver/en-US/76036838-fe0b-4227-aa58-08ea56596679/exec-spreaderrorlog-01inconsistency-for-sql-2000?forum=sqldatabaseengine guidelines, conventions SQL Server DBA and developer interview questions Evaluation of federated database servers SQL Server FAQ on programming, designing, administration, tools, replication SQL Server security best practices SQL Server administration best practices Well, we all know that sp_readerrorlog can be used to read the SQL Server error logs from within http://vyaskn.tripod.com/sp_readerrorlog_undocumented.htm T-SQL. If you call sp_readerrorlog without any parameters, it will display the current error log. You can go back to previous error logs, by specifying a number as the first parameter. So far so good. One fine evening, I noticed a post in the Microsoft SQL Server newsgroups, asking what the second, third and fourth parameters are for in sp_readerrorlog? Using sp_helptext, you can see that sp_readerrorlog accepts four parameters. But there's no information on the last three parameters. Well, that question went unanswered in the newsgroup. Not exactly, but a Microsoft technical support engineer answered saying, "It is undocumented". That response kind of made me curious and I started experimenting with sp_readerrorlog by passing it various kinds of parameters, analyzing the output, adjusting the parameters. Basically, a trial and error method :-) That wasn't difficult and exactly after experimenting for half an hour, I figured out the "Undocumented nature" of sp_readerrorlog. I concluded that sp_readerrorlog can be
by Subhro Saha in SQL Server: Administration ≈ 6 Comments TagsErro Log, sp_readerrorlog, SQL Server Log files, TSQL Many times, the size of the error log of SQL Server becomes huge if the Server is ONLINE for a long time https://subhrosaha.wordpress.com/2012/12/10/sp_readerrorlog-reading-sql-server-error-log-with-sql-command/ and we have not recycled the SQL logs manually. In these cases, to read SQL Server Logs from GUI is a pain. It takes a lot of time for the SQL Server GUI to load the log and during emergency we are always running against time.. There is a smarter way to read the SQL Server ErrorLog using TSQL Command which is faster than GUI. The name of the stored Procedure is sql server sp_readerrorlog and it allows us to read the contents of the SQL Server Error log from the SSMS and we can also filter the result set as per our requirement. sp_readerrorlog takes four parameters: Error log file we want to read: 0 = current, 1 = Archive #1, 2 = Archive #2, etc… Log file type: 1 or NULL = error log, 2 = SQL Agent log Search string 1: String one we want log in sql to search for Search string 2: String two we want to search to further refine the result set Examples: Exec sp_readerrorlog The above command all the contents from current SQL Server errorlog. Exec sp_readerrorlog 1,1,‘memory' The above command reads the first SQL Server Archived Error log and searches for returns the result wherever "memory" appears Let me know if anyone of you need more information regarding this topic. Cheers, Subhro Saha Subhro's BlogGoogle Related Post navigation ← Previous post Next post → 6 thoughts on “SP_ReadErrorLog: Reading SQL Server Error Log with SQL Command!!” Pingback: Reading Todays SQL Error Log With PowerShell | SQL DBA with A Beard Pingback: Fix Find Sql Server Error Log File Windows XP, Vista, 7, 8 [Solved] Pingback: Fix Sql Server Find Error Log Windows XP, Vista, 7, 8 [Solved] Pingback: Fix Sql Server 2000 Error Log Windows XP, Vista, 7, 8 [Solved] Pingback: Fix Sql Server Search Error Log Windows XP, Vista, 7, 8 [Solved] Anonymous said: January 4, 2015 at 9:02 pm Thank You Reply Leave a Reply Cancel reply Enter your comment here... Fill in your details below or click an icon to log in: Email (Address never made public) Name Website You are commenting using your WordPress.com account. (LogOut/Change) You are commenting using yo