T-SQL: User Defined Functions

Please see my other Database Development articles. Creating reusable logic As with Object-Oriented Programming (OOP) where it’s important to separate code used frequently into reusable modules, in T-SQL the same need exists. In this example I demonstrate a user-defined function (UDF) that receive a string from which all pre-defined matching blocks of HTML are found…

T-SQL: Trigger – INSERT AFTER

Please see my other Database Development articles. Initiating actions in response to events One of the new features provided with SQL Server 2005 enables actions to be performed after an event occurs on an object, in this case the “people” table. To illustrate an “after” response, the following code creates a trigger that responds to…

T-SQL: Subquery – SELECT

Please see my other Database Development articles. Performing multiple, concurrent queries Often when needing a resultset, there’s a need to perform multiple queries to derive the desired data. In this example, we have multiple records of people, from which we need an aggregated report. In order to accomplish this goal, I must perform two separate…