Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3211946
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:47:13+00:00 2026-05-17T14:47:13+00:00

I am developing a tool that will eventually be used to run a sql

  • 0

I am developing a tool that will eventually be used to run a sql script on 5000+ production databases simultaneously. For now it will only be used to run scripts on our Dev and QA databases. But I want to design it in the most extensible way, and have no experience doing something like this, so I could use some advice.

Technology I’m currently using: C# .Net 4.0 ADO.Net SMO

EDIT: I suppose by extensible I only mean able to run the scripts on an arbitrary number of databases in the most efficient way possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T14:47:14+00:00Added an answer on May 17, 2026 at 2:47 pm

    First I would recommend double-check if you cannot use one of the existing management facilities, like Policy Based Management or Central Management Servers. Specially PBM, it covers many operations that traditionally required something like ‘run this script on every database’. There are also many articles describing PBM in action, eg. Policy-based Management and Central Management Servers.

    Another thing to consider is to use PowerShell instead of C#/ADO/SMO. PS deliverables are scripts that are easily changed/maintained in production, as opposed to compiled executables. Also the object pipe model of PS makes a lot of tasks easier in PS than in raw C#. PS can use multithreaded execution. See SQL Server PowerShell Overview.

    Look into what other projects are out there than handle similar tasks. I myself have a project, dbUtilSqlcmd, that handles executing .SQL files in a ADO.Net environment (handling batch delimiter GO, handling sqlcmd variables :setvar and $(variable), handling :connect commands and so on).

    Last, if you end up writing code instead of using PBM, your bigger problems are going to be threading and error reporting. Don’t start a thread per server/database, 5000 threads are not viable. Use ThreadPool.QueueUserWorkItem instead. Better still, use the Tasks Parallel Library if possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a tool that will perform several types of analysis, and each analysis
I'm developing a tool that accesses SVN by running the command line SVN to
I am looking for recommendations for a tool that will let me construct a
I'm looking for an app that will compare the layout of 2 SQL tables.
I'm working on developing a webapp that will replace an existing PowerBuilder app. They
I am developing a tool where a short pass code is generated. That code
I am developing a tool which will convert html colors between maximum any format
i had written a code in t-sql that will create a table in sql
I am developing an application that will be deployed to Amazon EC2. I've had
I have been developing a WCF project that will expose web services (HTTP-based) that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.