Red Gate forums :: View topic - Run Backup without returning dataset
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Backup 7
SQL Backup 7 forum

Run Backup without returning dataset

Search in SQL Backup 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
mildmanneredjon



Joined: 16 Apr 2013
Posts: 2

PostPosted: Tue Apr 16, 2013 3:07 pm    Post subject: Run Backup without returning dataset Reply with quote

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?
Back to top
View user's profile Send private message
RBA



Joined: 05 Jun 2009
Posts: 148
Location: Cambridge

PostPosted: Tue Apr 16, 2013 10:02 pm    Post subject: Reply with quote

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,
_________________
Robin Anderson
Development
Red-Gate Software


Last edited by RBA on Wed Apr 17, 2013 10:13 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
mildmanneredjon



Joined: 16 Apr 2013
Posts: 2

PostPosted: Wed Apr 17, 2013 10:12 am    Post subject: Reply with quote

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

Jon.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group