Additional SQL Server features and topics not covered by specific categories
It is simplest to use powershell and a file with the list of servers.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I am looking to run single query on Multiple Sql Server instances as I can use SSMS to register all the servers or run in CMD but I have almost 300+ servers so looking better way to add servers via scripting.
Thank you and appreciate your help!
Additional SQL Server features and topics not covered by specific categories
Answer accepted by question author
It is simplest to use powershell and a file with the list of servers.
Cathy,
SqlCmd good but I have type each server connect command so for connecting to 100+ servers I have to do manually v/s PowerShell script which Tom mentioned.
Hi @Pds ,
You can also try to run a script against several servers using SQLCMD from command prompt. Please read the part two in this blog.
In addition, if the response from Tom is the solution that you want, please mark the useful reply as answer, it will benefit all community members who are having this similar issue. Your contribution is highly appreciated.
Thanks Tom, it was very useful.
I was running other PowerShell query but giving me trouble but this was very straight forward.
Thanks for quick response.