Run Backup without returning dataset

Forum for users of Redgate's SQL Backup tool

Run Backup without returning dataset

Postby mildmanneredjon » Tue Apr 16, 2013 2:07 pm

I'm wanting to run backups (EXECUTE master..sqlbackup ....) in SSMS but I do not want any datasets to be returned. I know you can omit the 2nd dataser by using the SINGLERESULTSET parameter but I also want to omit the first dataset. Is this possible?
Posts: 2
Joined: Tue Apr 16, 2013 2:02 pm

Postby RBA » Tue Apr 16, 2013 9:02 pm


Whilst I don't think SQL Backup doesn't have option to inhibit all result sets, you can hide its output by wrapping it in an sp_executesql command like so:

declare @sql nvarchar(2000)
set @sql = N'SELECT 1'
create table #temp (dummy nvarchar(max))
insert into #temp exec master..sp_executesql @sql

Where 'select 1' is your backup command and the temporary table schema matches the output format of SQL Backup, which I think it a single column of nvarchar.

Last edited by RBA on Wed Apr 17, 2013 9:13 am, edited 1 time in total.
Robin Anderson
Red-Gate Software
Posts: 148
Joined: Fri Jun 05, 2009 11:13 am
Location: Cambridge

Postby mildmanneredjon » Wed Apr 17, 2013 9:12 am

Many thanks for the reply. This has resolved my problem.

Posts: 2
Joined: Tue Apr 16, 2013 2:02 pm

Return to SQL Backup Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests