Using Dynamic SQL in Cursor Versus sp_MSforeachdb
sp_MSforeachdb yeilds unexpected results when you exclude databases compared to cursors.
sp_MSforeachdb yeilds unexpected results when you exclude databases compared to cursors.
Need to determine what domain users are associated with an Active Directory Group that has rights to your SQL Database. Use xp_logininfo.
I’ve been asked if there was a SQL 2000 version of the Table Space Calculation code I posted the other day. The answer is yes. It only required that I change the @Results table variable to a temp table, #Results. This will work on SQL 2000, 2005 and 2008. While I was at it, I modified the code to report back results in Mb (who cares for Kb anyhow?)