SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Multiple Process Procedure


Multiple Process Procedure

Author
Message
scrowder-536416
scrowder-536416
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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
RBarryYoung
RBarryYoung
SSCoach
SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)

Group: General Forum Members
Points: 19108 Visits: 9518
Two Words: "Service Broker"

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Steve Jones
Steve Jones
SSC Guru
SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)

Group: Administrators
Points: 82001 Visits: 19217
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
My Blog: www.voiceofthedba.com
scrowder-536416
scrowder-536416
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search