Q&A about the site for people organizing, marketing or licensing open source development projects
SET NOCOUNT ON; CREATE TABLE #dbs(dbid int, db sysname, c int); EXEC dbo.sede_ineachdb @SQLCommand = N'INSERT #dbs SELECT DB_ID(), DB_NAME(), COUNT(*) FROM sys.databases WHERE database_id < DB_ID();', @IncludeMainSites = 1, @IncludeMetaSites = 1, @IncludeMainMeta = 1; SELECT * FROM #dbs;