<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JasonSamuel.com &#187; SQL Server 2005</title>
	<atom:link href="http://www.jasonsamuel.com/category/sql-server-2005/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jasonsamuel.com</link>
	<description>Cool stuff I see in the IT world</description>
	<lastBuildDate>Sat, 17 Jul 2010 21:35:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Using Log Parser to query huge log files and only display the results you need</title>
		<link>http://www.jasonsamuel.com/2010/01/12/using-log-parser-to-query-huge-log-files-and-only-display-the-results-you-need/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=using-log-parser-to-query-huge-log-files-and-only-display-the-results-you-need</link>
		<comments>http://www.jasonsamuel.com/2010/01/12/using-log-parser-to-query-huge-log-files-and-only-display-the-results-you-need/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 20:57:18 +0000</pubDate>
		<dc:creator>Jason Samuel</dc:creator>
				<category><![CDATA[IIS]]></category>
		<category><![CDATA[SQL Express]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[Log Parser]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.jasonsamuel.com/?p=332</guid>
		<description><![CDATA[Have you ever had a giant log file or CSV that you needed to go through and pull results from quickly?  Sure you can try dumping it into Excel and trying different filters and sort orders but that&#8217;s a waste of time.  It&#8217;s much faster to pull your data via a query like in a [...]<p><a href="http://www.jasonsamuel.com/2010/01/12/using-log-parser-to-query-huge-log-files-and-only-display-the-results-you-need/">Using Log Parser to query huge log files and only display the results you need</a> is a post from: <a href="http://www.jasonsamuel.com">JasonSamuel.com</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Have you ever had a giant log file or CSV that you needed to go through and pull results from quickly?  Sure you can try dumping it into Excel and trying different filters and sort orders but that&#8217;s a waste of time.  It&#8217;s much faster to pull your data via a query like in a database.  Microsoft has a tool called Log Parser that does just that.  You can use queries to parse any kind of text based file.</p>
<p>You can download Log Parser 2.2 from Microsoft here:  <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en</a></p>
<p>Just install it and try it out by opening up a command prompt, navigating to your install path, and running the logparser executable.  It will display a list of commands to get you familiar with it.   I first started using it to parse huge IIS logs.  It&#8217;s pretty easy to use, here&#8217;s an example of pulling the top 10 pages hit on your site:</p>
<blockquote><p>logparser &#8220;SELECT TOP 10 cs-uri-stem as Url, COUNT(cs-uri-stem) AS Hits FROM c:\logs\ex*.log GROUP BY cs-uri-stem ORDER BY Hits DESC&#8221;</p></blockquote>
<p>or all the Error 500s for a particular site:</p>
<blockquote><p>logparser &#8220;SELECT [cs-uri-stem], [cs-uri-query], Count(*) AS [Hits] FROM c:\logs\ex*.log WHERE sc-status = 500 GROUP BY [cs-uri-stem], [cs-uri-query] order by [hits], [cs-uri-stem] DESC&#8221; -rtp:-1 -i:iisw3c</p></blockquote>
<p>You can even throw the above in a batch file that schedule to run every hour and do something like:</p>
<blockquote><p>All5005Errors.bat &gt; All500Errors.txt</p></blockquote>
<p>to log it all to disk.  Or even easier, use INTO in your SQL syntax to dump to a file like a .csv so it reads like:</p>
<blockquote><p>logparser &#8220;SELECT [cs-uri-stem], [cs-uri-query], Count(*) AS [Hits] INTO All500Errors.csv FROM c:\logs\ex*.log WHERE sc-status = 500 GROUP BY [cs-uri-stem], [cs-uri-query] order by [hits], [cs-uri-stem] DESC&#8221; -rtp:-1 -i:iisw3c</p></blockquote>
<p>There&#8217;s tons and tons of nice little queries people have written, for example I&#8217;ve personally used some from Jeff Atwood&#8217;s site here:  <a href="http://www.codinghorror.com/blog/archives/000369.html">http://www.codinghorror.com/blog/archives/000369.html</a></p>
<p>Or you can got to the IIS.NET forums where there is an entire forum and many sub-forums dedicated to Log Parser here:  <a href="http://forums.iis.net/default.aspx?GroupID=51">http://forums.iis.net/default.aspx?GroupID=51</a></p>
<p>Another cool tool over at CodePlex&#8230;Visual Log Parser:  <a href="http://www.codeplex.com/visuallogparser">http://www.codeplex.com/visuallogparser</a></p>
<p>I actually haven&#8217;t used this yet but it is out there if you get bored of using command line.  LMK if you guys decide to try it out.</p>
<p><a href="http://www.jasonsamuel.com/2010/01/12/using-log-parser-to-query-huge-log-files-and-only-display-the-results-you-need/">Using Log Parser to query huge log files and only display the results you need</a> is a post from: <a href="http://www.jasonsamuel.com">JasonSamuel.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasonsamuel.com/2010/01/12/using-log-parser-to-query-huge-log-files-and-only-display-the-results-you-need/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to move SQL error logs (ERRORLOG) to a different drive</title>
		<link>http://www.jasonsamuel.com/2009/11/04/how-to-move-sql-error-logs-errorlog-to-a-different-drive/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-move-sql-error-logs-errorlog-to-a-different-drive</link>
		<comments>http://www.jasonsamuel.com/2009/11/04/how-to-move-sql-error-logs-errorlog-to-a-different-drive/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 21:08:15 +0000</pubDate>
		<dc:creator>Jason Samuel</dc:creator>
				<category><![CDATA[SQL Express]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>

		<guid isPermaLink="false">http://www.jasonsamuel.com/?p=101</guid>
		<description><![CDATA[If you install SQL Server on your C: drive, you might notice after a while a that the ERRORLOG files begin filling it up.  It&#8217;s easy to move these off to another drive.  Just go to SQL Server Configuration Manger and under &#8220;SQL Server 2005 Services&#8221;, right click on &#8220;SQL Server&#8221; in the right pane [...]<p><a href="http://www.jasonsamuel.com/2009/11/04/how-to-move-sql-error-logs-errorlog-to-a-different-drive/">How to move SQL error logs (ERRORLOG) to a different drive</a> is a post from: <a href="http://www.jasonsamuel.com">JasonSamuel.com</a></p>
]]></description>
			<content:encoded><![CDATA[<p>If you install SQL Server on your C: drive, you might notice after a while a that the ERRORLOG files begin filling it up.  It&#8217;s easy to move these off to another drive.  Just go to SQL Server Configuration Manger and under &#8220;SQL Server 2005 Services&#8221;, right click on &#8220;SQL Server&#8221; in the right pane and click Properties.  Click on the Advanced Tab and scroll down to the &#8220;Startup Paramters section&#8221;.</p>
<p>Now be very careful here.  Click the little down arrow and select all the text you see.  Copy and paste it into Notepad so you can edit it easily.  It should look something like this:</p>
<blockquote><p>-dc:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf;-ec:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG;-lc:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf</p></blockquote>
<p>Edit the path for ERRORLOG to the new drive and folder.  The path must already be created so make sure you create this first.  Now paste your new paramaters back into the properties window and hit OK.  Once you make the change, restart the service and immediately all new ERRORLOGs will be written at the new path.  Here is an example of moving the logs off to the E: drive in a folder called &#8220;SQL error logs&#8221;:</p>
<blockquote><p>-dC:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf;-eE:\SQL error logs\ERRORLOG;-lC:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf<br />
 </p></blockquote>
<p><a href="http://www.jasonsamuel.com/2009/11/04/how-to-move-sql-error-logs-errorlog-to-a-different-drive/">How to move SQL error logs (ERRORLOG) to a different drive</a> is a post from: <a href="http://www.jasonsamuel.com">JasonSamuel.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasonsamuel.com/2009/11/04/how-to-move-sql-error-logs-errorlog-to-a-different-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/


Served from: www.jasonsamuel.com @ 2010-07-31 20:11:49 -->