Capturing the SQL Backup message output

Compresses, encrypts, secures and monitors SQL Server backups.

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

Capturing the SQL Backup message output

Postby khaff » Tue Feb 26, 2013 2:32 pm

In addition to capturing the @exitcode OUTPUT and @sqlerrorcode OUTPUT from the command line, I wish to also capture the the SQL Backup messages that are returned in the first dataset. Can anyone tell me how to do this?

Image[/img]
khaff
 
Posts: 1
Joined: Tue Feb 26, 2013 2:29 pm

Postby petey » Wed Feb 27, 2013 1:40 pm

Use the SINGLERESULTSET option e.g.

Code: Select all
CREATE TABLE #sqb (DATA NVARCHAR(4000))

INSERT INTO #sqb EXECUTE master..sqlbackup '-sql "BACKUP DATABASE pubs TO DISK = [<AUTO>] WITH SINGLERESULTSET"'
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
petey
 
Posts: 2233
Joined: Sun Apr 24, 2005 12:34 pm


Return to SQL Backup 7

Who is online

Users browsing this forum: No registered users and 1 guest