Dynamically Generating T-SQL Statements in SQL Server

This article discusses about dynamically generating T-SQL statements for SQL Server database administration and development purposes.   Why Dynamically Generating T-SQL Statements? So you have many databases, objects, etc. and you want to massively administer it right? In some of my previous posts I explained the undocumented stored procedures “sp_msforeachdb” and “sp_msforeachtable” that allow you … Read more…

Using the OUTPUT Clause: A simple data archiving example

In this article, we will be discussing about the OUTPUT clause in SQL Server, and how we can use it for creating data archiving mechanisms.   What is the OUTPUT Clause in SQL Server? The OUTPUT Clause in T-SQL as described in the relevant MS Docs article, “returns information from, or expressions based on, each … Read more…

Screencast: Object Dependencies in SQL Server 2008

SQL Server 2008 introduces among other new features and enhancements for accurately tracking Object Dependencies. This is very useful especially in cases where the user wishes to programmatically modify database objects having dependencies and therefore, he/she needs to resolve these dependencies before being able to proceed with the database object modification. For efficiently tracking dependencies … Read more…

Webcast on SQL Server 2008 T-SQL Enhancements Now Publicly Available!

A few days ago I delivered a Live Webcast on Microsoft SQL Server 2008 Programmability and more specifically on T-SQL Enhancements.   SQL Server 2008 T-SQL Enhancements Webcast’s Agenda During the Webcast I talked about the following SQL Server 2008 Programmability features: Variables Declaration and Initialization Compound Assignment Operators Large UDTs DATE, TIME, DATETIME2 New … Read more…

New Date-Related Functions in SQL Server 2008 and Later

Along with the new data types DATE, TIME and DATETIME2 in SQL Server 2008, new and enhanced functions are also included. New Date Functions Added in SQL Server 2008 and Later The new data functions originally added in SQL Server 2008 are : SYSDATETIME SYSUTCDATETIME SYSDATETIMEOFFSET SWITCHOFFSET TODATETIMEOFFSET A more thorough explanation follows: SYSDATETIME This … Read more…