Jeff's SQL Server Blog

Random Thoughts & Cartesian Products with Microsoft SQL Server
posts - 155, comments - 2679, trackbacks - 64

My Links



Welcome to my weblog. My name is Jeff Smith, I am software developer in Boston, MA and I was recently named a 2009 SQL Server MVP. Check in frequently for tips, tricks, commentary and ideas on SQL Server and .NET programming.



Post Categories




November 2004 Blog Posts

Returning Random Numbers in a SELECT statement

As it is implemented, the RAND() function in SQL Server doesn't let you return a different random number per row in your SELECT statement. For example ...


posted @ Monday, November 22, 2004 3:13 PM | Feedback (25) | Filed Under [ T-SQL ]

A Quick Lesson on SQL Indexes

Just a quick post of some benchmarking code for our good friend Guayo at TheDailyWTF, in regards to this discussion.

posted @ Friday, November 12, 2004 4:42 PM | Feedback (14) | Filed Under [ Miscellaneous T-SQL Techniques ]

The shortest, fastest, and easiest way to compare two tables in SQL Server: UNION !

When you have two tables (or resultsets from SELECT statements) that you wish to compare, and you want to see any changes in ANY columns, as well as to see which rows exist in 1 table but not the other (in either direction) I have found that the UNION operator works quite well.


posted @ Wednesday, November 10, 2004 9:29 AM | Feedback (152) | Filed Under [ T-SQL Techniques GROUP BY ]

Searching a column for all words, any words, or exact phrase in a SQL Table

Here's one way to implement a search, similar to Google's, if you don't want to (or can't) use full text indexing. This allows you to pass a string of words, and indicate that either ALL words must match, ANY must match, or the exact string must match.

posted @ Tuesday, November 02, 2004 4:35 PM | Feedback (27) | Filed Under [ T-SQL Code Library - SQL ]

Powered by:
Powered By Subtext Powered By ASP.NET