Module Name

List All User Created SQL (SP's, Functions, and Views)

Code to list all SP's, functions, and views created. Flipping the flag for is_ms_shipped shows all code, including system.

SQL for Bad Column Names

As part of a project, I imported a user's worksheets into SQL Server, before realizing that the column names were terrible, and very non-standard. This scripts generates the SQL to correct 3 column name errors, using a space, a hyphen, and a tilde.

Grouping Coalesce via XMLPath

Basic SQL showing how to coalesce and group simultaneously.

Database - Kill, Rename, and Drop

Shows better methods for killing processes that might be locking a Db rename or drop

Change Access Db Links

Changes TableDef and QueryDef objects with connection strings to a DSN-less connections.

Kill Locked Processes

T-SQL to kill all locked processes

Find String in SP's

As the title says, simple SQL to find strings within stored procedures...

SQL Execution Add-In for Excel (C# + Facade for VBA)

A C# library that simplifies some aspects of connecting to Db's and running SQL statements in a threaded manner. The C# code can also be exposed to Excel VBA, enabling it to simultaneously execute numerous SQL statements, something that cannot normally be done in VBA.

Get Number of Rows in SQL Objects

A stored procedure that returns the lines of code in various objects, in particular stored procedures or an entire database. Documentation is contained within the file.

Source:Third Abnormal Form

Competency Matrix for VBA

A developer, Sijin Joseph, reachable @, has an online Programmer Competency Matrix, which I have taken and converted to Excel.

CellSet, DataTable, Recordset Conversion (C#)

This C# code that generates a cellset from MDX, transforms it into a datatable, tranforms that into an ADODB recordset, and then creates a pivotcache/pivottable from the recordset. It gets around the inability of Excel 2003/2007 to create pivot tables directly from MDX.

An example of a stored procedure using the newer TryCatch block with transactions. Much cleaner and easier than the older style using trapped errors.

A 'naive' implementation of a logging class for ASP.NET and SQL Server. By naive, I mean that I wrote it when first starting out, so the code likely violates some basic design tenets.

An example of how join MDX and SQL results using relations in C#

Example of a class module used to interface between Access or Excel application and SQL Server.

An SQL function to calculate business days between dates, excluding holidays

Listing of ASCII character representation by number, as well as appearance if formatted as W*Dings in Excel.

Access MDB to backup stored procedures. Code checks for table's existence and creates if necessary. Requires modification of module level variables to fit your environment. Creates both a date-stamped folder of individual SQL files, as well as an export to a single HTML document.

Converts strings to tables, necessary with long strings that need to be incorporated into dynamic SQL, and this circumvents the 128-character limit.

Stored procedure to create crosstabs; extensive documentation on parameters inside file.

Backup Stored Procedures

Access code to backup stored procedures. Code checks for table's existence and creates if necessary. Requires modification of module level variables to fit your environment.

Code-based ALTER TABLE statement

Pass it the table, the field, and the type, and it executes an SQL statement to modify the field's table.