April 20, 2009 at 11:32 pm
Dear Experts,
Here i have a sceneraio like (Client request), i have to provide the query which has to result from two different servers and with two different databases in a single query statement.
Example : AGCNUSA - server ; AGUSA - DB
and AGCNUK - Server ; AGUK - DB these are two different servers located in two different networks.
As a pure DBA Usually i used to provide the errors count individually for two different servers. But my client asked me to provide the sigle query rather than running two different queries for error counts.
Can anyone please help me how can this be made for convinient.
------------------------------------------------------------------------
My Query :
select Tech_Mod,Tech_Mess ,count(*) from EForms4_Errors where
error_user in (select userid from AGUSA.dbo.users where roles like '%ag%') and
error_date between '2009-04-07 00:00:00 AM' and '2009-04-07 23:59:59 PM'
group by Tech_Mess,Tech_Mod
order by 3 DESC
------------------------------------------------------------------------
Thanks,
CH&HU.
Cheers,
- Win
"Dont Judge a Book by its Cover"
April 21, 2009 at 12:16 am
HI,
try using the linked server. u can get the result.
🙂
April 21, 2009 at 1:15 am
Linked server created already and there we are facing connectivity issues.
Can anyone provide the query which retrieve the data from two servers on different databases at a time.
Any idea if linking the sever throegh query itself.
Cheers,
- Win
"Dont Judge a Book by its Cover"
April 21, 2009 at 2:10 am
You can also consider Adhoc queries. For basic information visit my blog post http://blog.dbdigger.com/2008/09/accessing-remote-data-source-linked.html
DBDigger Microsoft Data Platform Consultancy.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply