2

I recently asked a question about exporting query plans (here Export Query Plans) and got some great answers.

However, I did run into one issue, during the process of interrogating SQL Server to obtain the plans, the process fails if there are any offline databases. Simple question, to which I suspect the answer is complex. How do I have the interrogation ignore the offline databases?

Thank you in advance for your assistance!

pshore73
  • 427
  • 3
  • 9

1 Answers1

1

Did you try:

get-sqldatabase -ServerInstance yourserver | Where-Object status -eq 'Normal'
Aaron Bertrand
  • 181,950
  • 28
  • 405
  • 624
ALZDBA
  • 36
  • 1