Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Multiple Process Procedure Expand / Collapse
Author
Message
Posted Saturday, June 28, 2008 9:12 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 3, 2011 11:20 AM
Points: 2, Visits: 20
I am writing a program that will connect to each of the 2600+ databases (v2000 and v2005) in our environment and pull permissions. i had written a script that would load the privs into the temp database for each server and then push them to a central repository. however, some of the temp dbs are configured differently from the other databases so i kept getting collate (?) errors.

so now, i'm looking to try something different. is it possible to write a stored procedure that will spawn connections to multiple servers, run queries on the databases, and insert the data to local tables all at the same time so that i dont have to wait for each server & database to complete?

If i need to clarify, please let me know.

Start main procedure
get list of servers
for each server:
connect and get list of databases
for each database:
pull permissions and send back to original database
repeat simultaneously on each database
repeat simultaneously on each server
Post #525571
Posted Saturday, June 28, 2008 9:47 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Thursday, December 4, 2014 7:52 AM
Points: 9,294, Visits: 9,495
Two Words: "Service Broker"


-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #525576
Posted Sunday, June 29, 2008 10:27 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 9:43 AM
Points: 31,370, Visits: 15,838
Or CLR procedures. you can spawn threads inside one of those.

However why do you want to? You complicate things and if you have issues with your code, you could create debugging headaches or other issues.

I used to manage hundreds of instances and we'd have processes that connected to every machine. Worked well.

The other thing you might consider is have a local admin database on each server. Set up the permissions job in there and have each server pull the data to the admin database. It's self contained and it allows you to hit each server directly and get the info.

Then have a central instance that connects to all these remote admin databases and gets the data. If it misses one or there's an issue, it still has the other data and you could always get to that local machine and see the data there.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #525628
Posted Tuesday, July 15, 2008 12:21 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 3, 2011 11:20 AM
Points: 2, Visits: 20
thanks for the suggestions. i ended up just rewriting the script to connect to the server first, write a record for all databases, then pull the permissions. thanks again though
Post #534656
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse