Gerrit Mantel
Programs SQL_STORED_PROCEDURE - prc_dump_survive_script

Main program

Nameprc_dump_survive_script
Type_descSQL_STORED_PROCEDURE
CommentSQLServer Stored Procedure

PURPOSE
Dump scriptfile to create TMP_SURVIVE database.

The output filename is survive_script.sql and is dumped to the given dump_path.
The dump_path must exist and will be checked.

With the generated script, it is possible to create a temporarily database TMP_SURVIVE,
which holds all necessary procedures to restore user databases from backup files.

PARAMETERS
- 1 @dump_path VARCHAR(255) Path to dump file to.

USED OBJECTS
- dbo.prc_restore_database (SP in local database) + referenced procedures and functions
- dbo.prc_save_text_to_file (SP in local database)
- dbo.fun_FolderExist (UDF in local database)
- sys.all_objects
- sys.sql_modules
- sys.sql_expression_dependencies

SQLSERVER CONFIGURATION
- OLE Automation has to be enabled.

EXAMPLES
EXEC dbo.prc_dump_survive_script @dump_path='C:\Data\MSSQL\survive'

HISTORY
2026-04-09 - Created procedure
2026-04-10 - Renamed procedure
- Changed output filename
2026-05-12 - Bug fix: Included wrong procedure name in survive_script

TAGS
<program>
<description>Dump scriptfile to create SURVIVE database</description>
<generic>0</generic>
<minversion>12</minversion>
<author>Gerrit Mantel</author>
<created>2026-04-09</created>
<lastmodified>2026-05-12</lastmodified>
</program>
DescriptionDump scriptfile to create SURVIVE database
Minversion12.0
Generic0
AuthorGerrit Mantel
Created2026-04-09 00:00:00
Lastmodified2026-05-12 00:00:00
Xp_cmdshell0
Ole_automation0
Subprogram_cnt1
Sourcecode

Sub programs

NameType descDescriptionMinversionGenericAuthorCreatedLastmodifiedXp cmdshellOle automation
prc_save_text_to_fileSQL_STORED_PROCEDUREWrite text variable to ansi file1Gerrit Mantel2017-01-25 00:00:002025-06-06 00:00:0001