Run Backup without returning dataset
mildmanneredjon
Posts: 3
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?
Comments
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,
Development
Red-Gate Software
Jon.