How can we help you today? How can we help you today?

Capturing the SQL Backup message output

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]
khaff
0

Comments

1 comment

  • petey
    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"'
    
    petey
    0

Add comment

Please sign in to leave a comment.