Last active
May 8, 2020 23:52
-
-
Save celsojr/eb6e36a69324f5b12a8a1ac58b07c41a to your computer and use it in GitHub Desktop.
Database restoration snippet for MSSMS
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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<_locDefinition xmlns="urn:locstudio"> | |
<_locDefault _loc="locNone"/> | |
<_locTag _loc="locData">Title</_locTag> | |
<_locTag _loc="locData">Description</_locTag> | |
<_locTag _loc="locData">Author</_locTag> | |
<_locTag _loc="locData">ToolTip</_locTag> | |
</_locDefinition> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Database restoration</Title> | |
<Shortcut></Shortcut> | |
<Description>Restore database</Description> | |
<Author>Celso Jr</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal> | |
<ID>FileName</ID> | |
<ToolTip>File full path</ToolTip> | |
<Default>file_name</Default> | |
</Literal> | |
</Declarations> | |
<Code Language="SQL"><![CDATA[USE [master] | |
ALTER DATABASE [PNCQDEV] | |
SET OFFLINE WITH ROLLBACK IMMEDIATE | |
GO | |
RESTORE DATABASE [PNCQDEV] FROM DISK = N'D:\$FileName$.bak' WITH REPLACE | |
ALTER DATABASE [PNCQDEV] | |
SET ONLINE | |
GO | |
]]> | |
</Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment