It’s a lot to learn…
My first real problem was a steady growth of open SQL Server connections. In my script I would use a Server object, which opened a database connection. When my script ended, the connection remained open, so next time I ran it a new connection would open. You can’t just let something like this continue—you’d eventually run out of connections!
After banging my head, experimenting, searching on Google, etc., for a few hours (I’m sure you’ve been there), I finally came across a link that showed me how to close the connection:
Call the Disconnect() method on the ConnectionContext property of the Server object.
Many thanks to the folks out there in the ether!