sede_ineachdb prototype

0

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

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;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results