Skip to content

Restore-SqlDscDatabase: New command proposal #2026

@johlju

Description

@johlju

Command proposal

Command that restores a database on a SQL Server Database Engine instance.

Proposed parameters

Parameter Mandatory Data type Description Default value Allowed values
ParameterName Yes String Detailed description None None

Special considerations or limitations

Suggest using WorldWideImporters for the tests as suggested in issue #1836.

Not sure this command would work best if it used SMO as suggested for a resource in issue #954 or build and invoke a T-SQL script like below.

USE [master];
GO
RESTORE DATABASE [WideWorldImporters]
FROM DISK = 'C:\Temp\WideWorldImporters.bak'
WITH
    MOVE 'WWI_Primary' TO 'C:\Data\WideWorldImporters.mdf',
    MOVE 'WWI_UserData' TO 'C:\Data\WideWorldImporters_UserData.ndf',
    MOVE 'WWI_Log' TO 'C:\Data\WideWorldImporters.ldf',
    MOVE 'WWI_InMemory_Data_1' TO 'C:\Data\WideWorldImporters_InMemory_Data_1',
    FILE = 1,
    NOUNLOAD,
    STATS = 5;
GO

Metadata

Metadata

Assignees

No one assigned

    Labels

    command proposalThe issue is proposing to add a new command to the module.in progressThe issue is being actively worked on by someone.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions