Skip to content

Commit

Permalink
#3190 sp_DatabaseRestore SQL Server 2022
Browse files Browse the repository at this point in the history
Adds new undocumented columns. Fixes #3190.
  • Loading branch information
BrentOzar committed Dec 11, 2022
1 parent 87bfc59 commit 587d559
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sp_DatabaseRestore.sql
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ CREATE TABLE #Headers
KeyAlgorithm NVARCHAR(32),
EncryptorThumbprint VARBINARY(20),
EncryptorType NVARCHAR(32),
LastValidRestoreTime DATETIME,
TimeZone NVARCHAR(256),
CompressionAlgorithm NVARCHAR(256),
--
-- Seq added to retain order by
--
Expand Down Expand Up @@ -521,6 +524,9 @@ IF @MajorVersion >= 11
IF @MajorVersion >= 13 OR (@MajorVersion = 12 AND @BuildVersion >= 2342)
SET @HeadersSQL += N', KeyAlgorithm, EncryptorThumbprint, EncryptorType';

IF @MajorVersion >= 16
SET @HeadersSQL += N', LastValidRestoreTime, TimeZone, CompressionAlgorithm';

SET @HeadersSQL += N')' + NCHAR(13) + NCHAR(10);
SET @HeadersSQL += N'EXEC (''RESTORE HEADERONLY FROM DISK=''''{Path}'''''')';

Expand Down

0 comments on commit 587d559

Please sign in to comment.