Recently I answered a question on AskSSC that I thought I would create a quick blog about. Someone had asked if there was an easy way to run SELECT * FROM SYS.PROCEDURES on every database. I immediately thought of the undocumented stored procedure sp_msforeachdb. I posted a response and gave a bit of advise to […]
Category: Query Tidbits
Using “NOT IN” in a query can provide mixed results
The topic came up at work awhile back with using various includes/excludes such as IN, NOT IN, and EXISTS. A co-worker was working on an ETL process when he discovered that using “NOT IN” in a sub query with a data set that contained NULL values was giving him incorrect data. Lets take a look […]