Commit for development environment setup

This commit is contained in:
2023-06-19 16:12:33 -04:00
parent be72063a3c
commit bbce2ad0a6
2209 changed files with 1171775 additions and 625 deletions

View File

@@ -0,0 +1,6 @@
select 'select ''' + name + ''' dbname, count(*) howmany from ' + name + '.dbo.contents cp
join ' + name + '.dbo.parts pp on pp.contentid = cp.contentid
join ' + name + '.dbo.items ii on pp.itemid = ii.itemid
join ' + name + '.dbo.contents cc on cc.contentid = ii.contentid
where cp.type = 20014 and cc.type = 20014 union' from sys.databases where name like '%WCN%'

View File

@@ -0,0 +1,2 @@
select 'select ''' + name + ''' dbname, count(*) howmany from ' + name + '.dbo.contents
where type = 20014 union' from sys.databases where name like '%WCN%'

View File

@@ -0,0 +1,18 @@
declare @dbNames nvarchar(max)
set @dbnames = 'VEPROMS_%'
declare @CommandLine nvarchar(max)
set quoted_identifier off -- Allows single quotes to be used in the query'
set @CommandLine = "
Select
sum(case when type = 0 then 1 else 0 end) Procedures
,sum(case when type between 10000 and 19999 then 1 else 0 end) Sections
,sum(case when type >= 20000 then 1 else 0 end) Steps
from ~Contents
"
set quoted_identifier on
declare @CommandLines nvarchar(max)
select @CommandLines = Coalesce(@CommandLines + ' UNION' + char(10), '') + 'select ''' + Name + ''' DBName, * from ( ' + Replace(Replace(@CommandLine,'~','{Name}.dbo.'),'{Name}',Name) + ') T1'
from Sys.Databases where name like @dbNames and name not like '%test'
Set @CommandLines = 'Select * from ( ' +@CommandLines + ') t2 '--where HowMany > 0'
print @CommandLines
EXEC SP_EXECUTESQL @CommandLines