> Where can I query the SQL Server Log? I'd like to see the Database Mirroring entries using T-SQL, not the log viewer.
>
> Thank-you,
> Rubens
Hmmm, ok... I don't think I want to see the SQL Server error log.
In a nutshell, I am setting up database mirroring for the first time, so I
am creating my own document with all the scripts included for how this is
done (specific to our organization). When you setup mirroring you can look
at the current SQL Server log file and see entries such as:
spid21s, Unknown, Database mirroring is active with database
'SQLTESTING_DBMIRROR' as the principal copy. This is an information message
only. No user action is required.
spid12s, Unknown, The Database Mirroring protocol transport is now listening
for connections.
I wanted to include a script in my document to pull these entries, just as a
confirmation that database mirroring is active. It's not a necessity
because it can be done through the current SQL Server log, but I just
thought it would be nice to have everything script based.
I will poke around with xp_readerrorlog and see if that has anything along
the lines of what I need.
Thank-you Linchi.
Rubens
> If you are talking about the SQL Server errorlog, it's not exactly
> query-able
[quoted text clipped - 13 lines]
>> Thank-you,
>> Rubens
Rubens - 26 Mar 2008 00:08 GMT
Bingo, xp_readerrorlog shows me those entries! That's pretty much what I
was looking for. Not a biggy, but is there any way to filter records with
xp_readerrorlog?
Thanks Linchi... as always!
Rubens
> Hmmm, ok... I don't think I want to see the SQL Server error log.
>
[quoted text clipped - 38 lines]
>>> Thank-you,
>>> Rubens
Andrew J. Kelly - 26 Mar 2008 00:45 GMT
sp_readerror log calls the up so have a look at this:
http://vyaskn.tripod.com/sp_readerrorlog_undocumented.htm

Signature
Andrew J. Kelly SQL MVP
Solid Quality Mentors
> Bingo, xp_readerrorlog shows me those entries! That's pretty much what I
> was looking for. Not a biggy, but is there any way to filter records with
[quoted text clipped - 46 lines]
>>>> Thank-you,
>>>> Rubens