从visual studio调用多个DB存储过程 [英] Call Mutiple DB stored procedures from visual studio

查看:184
本文介绍了从visual studio调用多个DB存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我正在使用Asp.net网站和SQL DB,出于安全考虑,我们为每个客户保留了不同的数据库。现在的问题是像存储过程这样的DB对象,每个数据库都会复制视图。如果我想要更改任何SP,视图或表格,那么我必须在所有数据库中执行此操作。有没有办法如果我将这些对象集成到visual studio中,如果我在visual studio中进行更改,它将在所有DB中生效。

Hello ,

I am working on Asp.net website and SQL DB, For Security reasons we are keeping different database for each customer. Now problem is DB objects like Stored Procedures, Views is replicated for each database. If I want to alter any SP ,views or table then I have to do it in all DB's. Is there any way that If I integrate that objects in visual studio and If I change in visual studio it will effect in all DB's.

推荐答案

我有同样的场景..但是在手动执行3-4次后,我开发了一个小的win表单应用程序,它将从一个集中式数据库中获取数据库列表,并将在每个表上执行脚本... **注意:我为我创建了该应用程序目的..我从来没有把它交给我的终端客户端客户。
I had same kind of scenario.. But After doing this manually for 3-4 times, I developed an small win form application which will fetch list of databases from one centralized database and will execute scripts on each table... **Note: I created that application for my purpose.. I never gave it to my client of end client.


根据我的理解,你在SAAS环境中。我现在正在工作的地方有70多个具有相同模式的数据库,sp,表...所以你应该做的是拥有一个共同的项目(cleintProject)并针对不同的客户端部署你的项目。因此,您将只维护将在所有数据库上部署的一个版本的代码。如果你有一些客户的特定代码,你仍然可以使用在这个解决方案中创建它,知道它只会被这个人使用。



希望它会帮助你。
From my understanding you are in SAAS environment. Where I am working right now with have 70+ databases with the same schema, sp, tables... So what you should do is having one common project (cleintProject) and deploy your project against the different clients. So you will maintain only one version of your code that will be deployed on all your DB. If you have some specific code for a client you can still use create it in this solution knowing that it will be used only by this guy.

Hope it will help you.


我使用ApexSql Diff来完成这项工作。



这真的很有用,维护一个并复制到所有人。< br $>


ApexSql Diff
I use ApexSql Diff to do this job.

It' really useful, maintain one and replicate to all.

ApexSql Diff


这篇关于从visual studio调用多个DB存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆