Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 querying data from different server

Author  Topic 

gangadhara.ms
Aged Yak Warrior

549 Posts

Posted - 2011-08-01 : 01:43:08
Dear All,

I need to query a database table from different server and i am using below query

select * from [JNJAUSYSVR01].[EMPOWER].[dbo].[employee]

but its not working


Pls suggest

Thanks,
Gangadhara MS
SQL Developer and DBA

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-08-01 : 02:05:34
create a linked server to JNJAUSYSVR01


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-01 : 04:19:52
another way is to use OPENROWSET if this is for an adhoc purpose

http://msdn.microsoft.com/en-us/library/ms190312.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -