Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

In my project architecture, we heave two servers node1 and node2. node1 we are performing all CRUD operations on physical tables and node2 we are performing only select statements.

But my stored procedures having below structure

insert
|
select
|
update

How can i rewrite my stored procedure to executing insert and update as node1 and select from node2.

Thanks for advance, still need any clarification ping me.

What I have tried:

i got only one suggestion from my Architect , re write the code using .net language functions.
Posted
Updated 26-Jun-17 21:49pm
Comments
Tomas Takac 27-Jun-17 3:39am    
I would suggest you talk about this to your colleagues. If you loop them in now you will avoid unwanted surprises later. It is also good to have some sort of agreement on how to solve this so everybody knows why this is happening and why you picked this particular solution.

1 solution

First of all you have to establish a kind of connection between the two servers to enable communication...
The SQL solution for that is called linked-server[^]...
You have to decide on which server the SP runs and set up the linked server accordingly...
When all in place you can access the tables on the linked server using this form:
SQL
[server].[database].[schema].[table]
 
Share this answer
 

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