Trying to backup linked server log - High Availabilty

  • Hi,

    Long story short - I need to backup the log on my listener server (using High Availability).

    I am trying to create a tsql script that i can run from my primary on my listener to clear the log file.

    I setup a read only linked server and tested :

    select * from openquery([sqlnodea\sql2014a],'select @@servername')

    This works fine.

    So when I attempt this my syntax is wrong:

    select * from openquery([SQLNODEB\SQL2014A],'BACKUP LOG [pec_prod] TO DISK = N''nul' WITH NOFORMAT, INIT,

    NAME = N'pec_prod-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10

    GO

    ')

    I get the red lines under everything..tried all kinds of ways to get this to run. I can get the above to work by itslef, but when I try to add it to open query I get the red lines.

  • got it thanks guys

  • Can you share? It looks like you just didn't double-up the single quotes within your string, but I want to be sure.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply