July 20, 2015 at 7:23 am
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.
July 20, 2015 at 7:27 am
got it thanks guys
July 20, 2015 at 1:31 pm
Can you share? It looks like you just didn't double-up the single quotes within your string, but I want to be sure.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply