Automate a query on registered servers

  • Currently I am using SQL Server 2008 express to run a query against databases at each of my locations and saving the results to a .csv file to be loaded into another system for reporting purposes. Since we have over 70 locations I created a Local Server Group under registered servers to avoid having to write a large union query. Is there a way to set a query up to run against a local server group automatically at a scheduled time to create this file?

  • This solution using registered servers probably won't work very well for you. Registered servers are used by Management Studio and are stored in the registry for the particular user (HKEY_CURRENT_USER) and will not be visible to anyone else when they attempt to run your script. This includes you when you attempt to access the registry from SQL code - the user when this is happening is actually the user that the SQL Server service is running under.

    A better choice would be to create a table somewhere that has the list of servers and use this for you query

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply