Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5329eab
commit b2bb050
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
EXEC sp_MSforeachdb ' | ||
--Table variable to capture the DBCC DBINFO output, look for the field we want in each database output | ||
DECLARE @DBCC_DBINFO TABLE (ParentObject VARCHAR(255) NOT NULL, [Object] VARCHAR(255) NOT NULL, [Field] VARCHAR(255) NOT NULL INDEX idx_dbinfo_field CLUSTERED, [Value] VARCHAR(255)); | ||
DECLARE @DBCC_DBINFO TABLE (ParentObject VARCHAR(255) NOT NULL, [Object] VARCHAR(255) NOT NULL, [Field] VARCHAR(255) NOT NULL | ||
INDEX idx_dbinfo_field CLUSTERED --just this line is SQL 2014+ only | ||
, [Value] VARCHAR(255)); | ||
INSERT INTO @DBCC_DBINFO EXECUTE ("DBCC DBINFO ([?]) WITH TABLERESULTS"); | ||
SELECT ''?'', [Value] FROM @DBCC_DBINFO WHERE Field = ''dbi_dbccLastKnownGood'';'; | ||
SELECT DISTINCT ''?'', [Value] FROM @DBCC_DBINFO WHERE Field = ''dbi_dbccLastKnownGood'';'; |