The script below should give you the servername for each server you connected to. But what if the second one is offline? Or perhaps you don’t have login permission to it? Then it should ignore the error and go to the third one right? No it doesn’t. For some reason on error ignore seems to do just about nothing. I’ve tried it in lots of different methods in this script and I can’t get it to ignore and keep going. Anyone else run into this?
:connect sqllaunchvpc
select srvname from master..sysservers where srvid = 0
GO
:connect sqllaunchvpc\sqldev01
:ON ERROR ignore
select srvname from master..sysservers where srvid = 0
GO
:connect sqllaunchvpc\sqldev02
:ON ERROR ignore
select srvname from master..sysservers where srvid = 0
GO
Pat
Alright so I haven’t had the best week for my SQL databases lately. But that’s ok they are getting better and those things that don’t kill us make us stronger right. J
I ran into an interesting Performance counter issue yesterday. SQL Server stopped tracking stats inside its engine for major items like wait stats, and Read,cpu,writes for traces. This was a little odd and really screwed things up for us since we were trying to find a performance issue. So I found this KB Article . We found that if you have perfmon running against the server when you reboot this is caused by this. Now I’ve had perfmon up tons while rebooting but I’m starting to wonder if SQL Sentry might have helped out since they take more counters and more frequently. So we stopped all perfmon’s to the server and I stopped the sentry service and this time they came back up ok. I don’t think it’s a bad thing that sentry does this it’s just a necessary item. Or move to SP4 which is now in our near future. J
Pat