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 2003 Blog Posts

A Recursive User-Defined Function (SQL Server 2000)

Anyone know what this will return? Unfortunately, the argument must be less than or equal to 32 due to the number of levels of recursion SQL can handle. It's probably not very efficient, either. But, it's pretty cool!

posted @ Friday, November 21, 2003 4:33 PM | Feedback (3) | Filed Under [ T-SQL ]

ASP Report Class Northwind Sample

As promised, here's a sample ASP report from Northwind using my ASP Report Class (  Hopefully, everyone will agree that the script is very easy to write and read and much shorter.   All grouping (for both headers and footers), subtotals and running totals are completely taken care of by using the class, and it is giving you recordset functionality (movenext and EOF and column reference by name) using the speedy GetRows() method under the hood. For this to work, you must have the class saved as “ReportClass.asp“ in the same folder as this script (notice the include). <%@ Language=VBScript %> <%Option Explicit%> <%@ Language=VBScript %>

posted @ Thursday, November 20, 2003 5:22 PM | Feedback (4) | Filed Under [ ASP ]

ASP - Report Class with Grouping, Headers, Footers and more

If you use ASP, ADO and SQL Server, check out my new article. It includes code for a VBScript class which makes writing HTML reports based on an ADO recordset with group headers, footers, and subtotals extremely easy.


posted @ Monday, November 17, 2003 1:36 PM | Feedback (1) | Filed Under [ ASP ]

SQL WHERE clauses: Avoid CASE, use Boolean logic

As some of you may know, I recommend to avoid using CASE expressions in the WHERE clause of a query to express conditional logic. I prefer to have everything translated to simple ANDs, ORs and NOTs to keep things a) portable, b) easier to read and c) efficient.

posted @ Friday, November 14, 2003 12:12 PM | Feedback (38) | Filed Under [ T-SQL Techniques Efficiency ]

Powered by:
Powered By Subtext Powered By ASP.NET