1) Change the Database Name below from YourDBName to the name of the target DB.
2) If XP_cmdshell is blocked, use the statement below to enable it.
--Use when XP_cmdshell gets blocked
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO
3) Run the statement on the Target DB.
4) Exec ITX_SP_BAK A file will be created on the target server's c drive.
@P INT, --Back up Procs 1=yes 0=no
@FN INT, --Back up Functions 1=yes 0=no
@V INT --Back up Views 1=yes 0=no