Monday, February 28, 2005

Flattening Out Data with One of the Coolest SQL Tricks Ever

 
This is sweet...

Return a delimited list of child values in your SQL. For report-loving folks, or others.



Tuesday, February 15, 2005

Firefox Speed Tips

 
From Firefox Tuning - MozillaZine Forums...

Type "about:config" in your FireFox address bar, then make the following changes:

network.http.pipelining = true
network.http.maxrequests = 8
network.http.proxy.pipelining = true
browser.turbo.enabled = true

Note that the above changes should result in a visible speedup (they did for me), but you may experience some display glitches or other issues on a few sites. If you have too many problems, revert the above parameters to their original settings.



Monday, February 07, 2005

Log Parser 2.2 Released!

 
Finally, Log Parser 2.2 has been released. If you didn't know, LogParser is a great little tool that will rip through log files & delimited data files (Event logs, IIS logs, CSV, etc) & allow you to execute SQL-like queries against the data. It even has a COM interface.

The new version, 2.2, supports some new data types & SQL commands, and also will generate graphs based on query results, e.g. to calculate the distribution of the HTTP response status codes from your IIS log files:

C:\>LogParser "SELECT sc-status, COUNT(*) AS Times INTO Chart.gif 
FROM ex*.log GROUP BY sc-status ORDER BY Times DESC" –
chartType:PieExploded3D -chartTitle:"Status Codes"


generates this



The above example is from the logparser examples page.

So, if you have a bunch of log files & want to run some easy queries against it, check out logparser.



Tuesday, February 01, 2005

Another test site

 
Again, in the vegas theme... :)



Test site

 
I recently realized that I could probably put together a few small sites using the tech I developed for development now. I've received numerous comments from visitors saying how the arrangement & information helps them find the information they need, so I might as well leverage it to help out people in other areas. So the first of those sites is blackjackjungle. I'll use it as a testbed for tech & ideas, since I don't want to mess with developmentnow too badly. Plus, I visited vegas recently, and let's just say I stink at blackjack & poker. I didn't want to play slots, and I'd be afraid to visit most gambling sites (popups, spyware, etc.). So a nice forums site focused on content & information exchange would be a nice thing. Hence my new site.

An aside -- if you visit blackjackjungle you'll notice a number of ads for the jungle book and other jungle-related stuff. I stripped out the word jungle everywhere I could, but apparently some of my pages are unclear enough that Google latches onto the word "jungle" in the domain name. So a word to the wise -- when you're picking out a domain name, be careful what you choose. Because it could come back to bite you (in the jungle). :)



SQL Server timestamp column

 
SQL Server 7/2000 supports a column type of timestamp. A table can only have one timestamp column, and you cannot set its value directly. Instead, a timestamp column's value is automatically updated whenever a record is inserted or updated.

However -- and this is the part that threw me off initially -- the actual value of a timestamp column is not a date, not a datetime. It has nothing to do with time at all. Instead, a timestamp column contains abinary number value. That value is incremented automatically when a record is updated. It's best to think of it as a version or revision number.

So...when you create a timestamp column, make sure to name it something like Revision, Version, something. B/c I guarantee if you call is timestamp, you'll confuse someone. At least initially. :)

If you want a datetime column (e.g. LastUpdateDate) that is automatically updated when you insert and update a row, you can give it a default value of getdate(), and add an update trigger on that table that updates the value to getdate() or something. If you hate triggers (or need to avoid them for performance reasons), I guess you could just ensure that every proc & application that modifes the record also updates your LastUpdateDate column. But I think a trigger would be simpler & safer in most cases.




Archives
September 2004   October 2004   November 2004   December 2004   January 2005   February 2005   March 2005   April 2005   May 2005  

This page is powered by Blogger. Isn't yours?