Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add support for new SQL Server 2022 snapshot backup / restore functionality

Open
#39 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
sql
Domain
databases

Research direction

Start with the SQL Server snapshot backup documentation linked in the issue and compare its examples with ScriptDOM's current parsing behavior. Check the listed ALTER DATABASE, ALTER SERVER CONFIGURATION, BACKUP, and RESTORE statements, including their new options. Done means the shown snapshot backup and restore syntax is recognized by ScriptDOM without confusing it with database snapshots.

Written by the indexing model from the issue text.

Description

enhancement sql-feature

SQL Server 2022 introduced a new type of backup - snapshot. ScriptDom currently does not support this type of backup. Note that this is different from the database snapshot functionality, which has been around since SQL Server 2005. In addition, there are new statements (BACKUP GROUP and BACKUP SERVER) in SQL Server 2022 which work in conjunction with these snapshot backups. There are also new options like SUSPEND_FOR_SNAPSHOT_BACKUP for ALTER DATABASE and ALTER SERVER CONFIGURATION, which are not recognized by ScriptDom. Example of statements which should be handled by ScriptDom are below. There are more examples in the docs linked to earlier.

ALTER DATABASE testdb1
SET SUSPEND_FOR_SNAPSHOT_BACKUP = ON
(MODE = COPY_ONLY);

ALTER SERVER CONFIGURATION
SET SUSPEND_FOR_SNAPSHOT_BACKUP = ON
(GROUP = (testdb1, testdb2), MODE = COPY_ONLY);

BACKUP DATABASE testdb1
TO DISK = 'd:\temp\db.bkm'
WITH METADATA_ONLY, FORMAT;

RESTORE DATABASE testdb1
FROM DISK = 'd:\temp\db.bkm'
WITH METADATA_ONLY, FILE = 3, REPLACE, --> no DBNAME clause - restore first database in backup set
MOVE 'testdb1' TO 'd:\temp\snap\testdb1.mdf',
MOVE 'testdb1_log' TO 'd:\temp\snap\testdb1_log.ldf';
Dominant language
GAP
Stars
277
Forks
43
Avg merge
6d 17h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/SqlScriptDOM

All issues in microsoft/SqlScriptDOM

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.