Tuesday 24 April 2018

Backup all MSSQL databases

Backup all MSSQL databases

1. Log into your server through Remote Desktop Connection.
2. Open SQL Server Management Studio and select the server name
3. Click the New Query button and enter in the following data:

DECLARE @name VARCHAR(50) — database name
DECLARE @path VARCHAR(256) — path for backup files
DECLARE @fileName VARCHAR(256) — filename for backup
DECLARE @fileDate VARCHAR(20) — used for file name
SET @path = ‘C:\Backup\’
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)
DECLARE db_cursor CURSOR FOR
SELECT name     Read more...

No comments:

Post a Comment