Showing posts with label sp_backup. Show all posts
Showing posts with label sp_backup. Show all posts

Friday, December 19, 2025

.::: Create Script Backup All Database Full, Differential & Log Using T-SQL & Run using CMD SQL Server - Basic Update sp_backup_full_basic :::.

 
correlation https://teguhth.blogspot.com/2023/08/create-script-backup-database-full.html

1. enable xp_cmdshell

EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 1;
RECONFIGURE;
    

2. create t-sql sp_backup_full_basic

IF DB_ID('dbatools') IS NULL
BEGIN
    CREATE DATABASE [dbatools];
END
GO

USE [dbatools];
GO

CREATE PROCEDURE [dbo].[sp_backup_full_basic]

-- =============================================  
-- Author: Teguh Triharto
-- Create date:  22 March 2000
-- Description: Script Backup Database
-- Website : https://www.linkedin.com/in/teguhth"
-- =============================================  
 

Popular Posts