Run Backup without returning dataset

Compresses, encrypts, secures and monitors SQL Server backups.

Moderators: JonathanWatts, Chris Auckland, eddie davis, Colin Millerchip, Brian Harris, james.billings, RBA, petey

Run Backup without returning dataset

Postby mildmanneredjon » Tue Apr 16, 2013 3: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?
mildmanneredjon
 
Posts: 2
Joined: Tue Apr 16, 2013 3:02 pm

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

Hi,

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.

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

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

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

Jon.
mildmanneredjon
 
Posts: 2
Joined: Tue Apr 16, 2013 3:02 pm


Return to SQL Backup 7

Who is online

Users browsing this forum: No registered users and 0 guests