File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636END ;
3737GO
3838
39- /*
40- Add growth-rate and VLF columns to an existing table (idempotent).
41- Needed when re-running this script against a pre-2.3.0 database.
42- The ALTER PROCEDURE below references these columns, so they must
43- exist before SQL Server compiles the procedure body.
44- */
45- IF OBJECT_ID (N ' collect.database_size_stats' , N ' U' ) IS NOT NULL
46- BEGIN
47- IF NOT EXISTS
48- (
49- SELECT 1 / 0
50- FROM INFORMATION_SCHEMA .COLUMNS
51- WHERE TABLE_SCHEMA = N ' collect'
52- AND TABLE_NAME = N ' database_size_stats'
53- AND COLUMN_NAME = N ' is_percent_growth'
54- )
55- BEGIN
56- ALTER TABLE collect .database_size_stats ADD is_percent_growth bit NULL ;
57- END ;
58-
59- IF NOT EXISTS
60- (
61- SELECT 1 / 0
62- FROM INFORMATION_SCHEMA .COLUMNS
63- WHERE TABLE_SCHEMA = N ' collect'
64- AND TABLE_NAME = N ' database_size_stats'
65- AND COLUMN_NAME = N ' growth_pct'
66- )
67- BEGIN
68- ALTER TABLE collect .database_size_stats ADD growth_pct integer NULL ;
69- END ;
70-
71- IF NOT EXISTS
72- (
73- SELECT 1 / 0
74- FROM INFORMATION_SCHEMA .COLUMNS
75- WHERE TABLE_SCHEMA = N ' collect'
76- AND TABLE_NAME = N ' database_size_stats'
77- AND COLUMN_NAME = N ' vlf_count'
78- )
79- BEGIN
80- ALTER TABLE collect .database_size_stats ADD vlf_count integer NULL ;
81- END ;
82- END ;
83- GO
84-
8539ALTER PROCEDURE
8640 collect .database_size_stats_collector
8741(
You can’t perform that action at this time.
0 commit comments