Click here to Skip to main content
15,921,577 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to insert data form one server to another table wise for example i have table tab_subject it is in one server and i want sent data of tab_subject to another server by writing query in sql server 2008 my query is given below

Insert into 192.168.2.30.DbBranchServer.dbo.Tab_subject
(TABKEY,CDESC)
select
distinct
sbj.TABKEY ,
sbj.CDESC
Subject from
TAB_SUBJECT sbj
where SubType='CBE'
and Status='1' and
not exists(select
TABKEY
from
192.168.2.30.DbBranchServer.dbo.Tab_subject Ts
where sbj.TABKEY=Ts.TABKEY)

this query is giving error on this line 192.168.2.30.DbBranchServer.dbo.Tab_subject

kindly help me how should i do this .
Posted

1 solution

Really, it would have been helpful if you would have informed us of what error the line is giving.

I'll take a stab at this: you normally need "Linked Servers" to do this type of operation. You can look that up - but it's an administrative privilege and you'd probably want to seek the server administrator's help in this.

 
Share this answer
 
Comments
Tahir Mahmood From karachi 15-Apr-15 8:56am    
error is that invalid 192.168.2.30.DbBranchServer.dbo.Tab_subject

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900