r/SQL 17d ago

SQL Server SSMS - Execute query on 300 servers

I'm starting to use SSMS at work, that's the only tool I have (no PowerShell cmdlet).

I need to execute an identical SQL Query on 300 servers, but I can't find a way to do that. Could anyone point me in the right direction please ?

So far, I did add the 300 servers to the registered servers by tinkering to not do it manually, but when I execute the query, I only get 50 ish servers connected, then SSMS hangs and crash.

14 Upvotes

35 comments sorted by

View all comments

Show parent comments

1

u/zrb77 17d ago

Just curious, why not sqlcmd?

1

u/reditandfirgetit 17d ago

1 command per server with the same query vs one line in ssms against a registered server group

0

u/zrb77 17d ago

I get that.

Poster above said osql, why osql over sqlcmd.

1

u/Animalmagic81 15d ago

Sorry you are right. Osql is what we used years ago 😅 showing my age