Capturing the SQL Backup message output

khaffkhaff Posts: 2
edited February 27, 2013 7:40AM in SQL Backup Previous Versions
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?

XProcOutput02.gif[/img]

Comments

  • peteypetey Posts: 2,358 New member
    Use the SINGLERESULTSET option e.g.
    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 8
Sign In or Register to comment.