Fill Missing Dates without Loops

A common task Database Developers must perform is to create a query that returns data for a date range. All dates must be returned regardless of if there is data for a given date. This is a solution that is fast. Continue reading

XML Columns Can’t Travel Across Links

Tables that have an XML data type cannot be queried across a linked server even if the XML column is unused in the query … or can they? Continue reading

Tips for SQL Mail to Database Mail Upgrade

Keep a close eye on emails after an upgrade from SQL Mail to Database Mail Continue reading

Move Objects to a new Schema

Have you ever run a script from a vendor that creates a bunch of database objects only to have them all created in the wrong schema? (Thanks for the “help”…) Here’s a script to move all the database object in one schema to another schema. Continue reading

Replace All Email Addresses in a String

This query will search through a string, find all email addresses for a given domain and change them to a different email. Great when you’re copying a production database to a test server to refresh the data but you don’t want production emails Continue reading

Are my Linked Servers Being Used?

A t-sql query to find all database objects in all databases on a server that use a linked server … and those linked servers no longer used. Continue reading