[英]Can I use a stored procedure from one server on another with entity framework (asp.net mvc)?
I am writing an application which connects to multiple servers and queries their settings and inventory information to store in a database on another server. 我正在编写一个连接到多台服务器并查询其设置和清单信息以存储在另一台服务器的数据库中的应用程序。 The number of servers is dynamically changing, but the server that the database information remains on is constant. 服务器的数量是动态变化的,但是数据库信息保留在其上的服务器是恒定的。
I haven't yet figured out how to create a dynamic connection using Entity Framework, but that is another question (although it would be nice to know if that is possible...). 我还没有弄清楚如何使用Entity Framework创建动态连接,但这是另一个问题(尽管很高兴知道这样做是否可行...)。 For obvious security reasons, they look down upon using raw sql strings in code to query a server and would prefer that any queries are done in the form of stored procedures. 出于明显的安全原因,他们看不起在代码中使用原始sql字符串来查询服务器,并且希望任何查询都以存储过程的形式进行。
Once I begin this and maintain a connection between the two servers, I will need to query the server that I have dynamically connected to using a stored procedure that is on the server where the information will be stored. 一旦开始并维持两台服务器之间的连接,我将需要使用存储信息的服务器上的存储过程来查询已动态连接到的服务器。
Is there a way to do this? 有没有办法做到这一点? Or are stored procedures limited to the server that they are placed upon? 还是存储过程仅限于放置它们的服务器?
Linked Server will work. 链接服务器将正常工作。 For more information check out this link: 有关更多信息,请查看此链接:
https://msdn.microsoft.com/en-us/library/ff772782.aspx https://msdn.microsoft.com/zh-CN/library/ff772782.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.