Sql Database Backup Query

Sql Database Backup Query



To backup database using SQL query, you can use the following query, but this is for manual keep and using from the query windows. if you want to regular backup query you can setup SQL Job in SQL server Management Studio

to set Sqljob click in  setup-sql-job-for-backup-database.html
To view Full Video click in  Setup Sql job for backup Database

declare @name varchar(max)

set @name= 'Full path\databasebackupname_'+(replace(convert(varchar,getdate(),112) + convert(varchar,getdate(),114),':',''))

BACKUP DATABASE Databasename

TO DISK =@name

)



eg.



declare @name varchar(max)

set @name= 'E:\MEDIFLOW_BACKUP\Mediflowbackup_'+(replace(convert(varchar,getdate(),112) + convert(varchar,getdate(),114),':',''))

BACKUP DATABASE Mediflow

0 Comments