sede_ineachdb prototype

0

Please login or register to vote for this query.

(click on this box to dismiss)

Open Source Meta

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;

Enter Parameters

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