Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
T-SQL (SS2K8)
»
Running Query on Multiple Database/Servers
Running Query on Multiple Database/Servers
Rate Topic
Display Mode
Topic Options
Author
Message
ShuaibV
ShuaibV
Posted Wednesday, March 20, 2013 4:20 PM
SSC Journeyman
Group: General Forum Members
Last Login: 2 days ago @ 3:12 PM
Points: 99,
Visits: 270
Hi
I have a database table that contains all the server details. I have a query and wanted to run against all servers available in the table.
Sample Query:
SELECT DISTINCT Col1, Col2 FROM dbo.Test
Requirement
1. Connect to one server
2. Run the Query against all the user DB and save the results into a table.
Please suggest a best way to from SQL server.
Thanks
Shuaib
Post #1433539
Erin Ramsay
Erin Ramsay
Posted Wednesday, March 20, 2013 4:52 PM
SSC-Addicted
Group: General Forum Members
Last Login: Yesterday @ 4:30 PM
Points: 421,
Visits: 776
Have a look at this, perhaps it will help.
http://msdn.microsoft.com/en-us/library/ms188427(v=sql.105).aspx
Post #1433543
opc.three
opc.three
Posted Saturday, March 23, 2013 2:27 PM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 11:14 PM
Points: 6,706,
Visits: 11,738
Here is how you would do it using SSIS:
Iterate Over Databases Using SSIS – Part 2
__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Believe you can and you're halfway there.
--Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler
--Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them.
--Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples.
--Giordy
Post #1434626
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.