sp_msforeachdb: Improving on an Undocumented Stored Procedure

Have you ever wanted to run a query across every database on a server with the convenience of a stored procedure? If so, Microsoft provided a stored procedure to do so. It’s unreliable, outdated, and somewhat obfuscated, though. Let’s improve on it!

4.72 (43)

2016-04-15 (first published: )

14,695 reads

Database Design Follies: NULL vs. NOT NULL

It sounds simple enough. Either your column will always have a value or it may not. Yet somehow such a seemingly simple decision can become a never-ending debate where database schema begins to resemble superstition and designing effective tables seems more contentious than you expected it to be.

4.38 (78)

2016-02-26 (first published: )

22,259 reads

Blogs

Disabling Non-Clustered Indexes For Fun and Profit

By

One of the frequently quoted ETL best practices is to disable your non-clustered indexes...

Steps for a Successful Data Migration Session at Microsoft Ignite

By

I hope you’re all enjoying the latest rev of the Microsoft Ignite conference as...

Daily Coping 2 Mar 2021

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Read the latest Blogs

Forums

Machine Learning Services on Database Server verses R Lang Execution on Laptop

By HookSQLDBA7

We are running SQL Server 2017 (RTM) on Windows. The question came up, if...

Stored Procedure "Caching"

By LightVader

I'm having an issue with a database that I recently moved from SQL 2014...

SQLSaturday Foundation

By Steve Jones - SSC Editor

We are setting up this thread to welcome questions and comments about the latest...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

Adding N/A

See possible answers