ASP.net 网站在 SQL Server 上设计/构建 过渡到 DB2
长话短说,我们设计并构建了一个使用 asp:SqlDataSource 和 System.Data.SqlClient 连接到独立 SQL Server 2000 数据库的 Web 应用程序,现在我们正在考虑迁移到 db2 集群。除了连接字符串之外,我们还需要在 Web 应用程序上执行任何操作吗?我对DB2一无所知。如果这有什么区别的话,我们在 SQL 中有近千个存储过程。
OK long story short, we designed and built a web application connecting to a standalone SQL Server 2000 database using asp:SqlDataSource and System.Data.SqlClient, now we are looking at migrating to a db2 cluster. Aside from the connection string, do we need to do anything on the web application? I am clueless about DB2. We have close to a thousand stored procs in SQL if that makes any difference.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。 Db2 使用与 sql server 不同的提供程序。因此,首先您需要找到并安装该提供程序(它可能随您的 DB2 安装一起提供,或者可以从 IBM 获得),然后更改您的
SqlClient
命名空间引用以使用IBM.Data.DB2< /代码> 相反。此外,类名也会发生变化。因此,例如,
SqlCommand
类型需要更新为使用DB2Command
。此链接应该有帮助:http://www.ibm.com/developerworks/data/library /techarticle/dm-0502alazzawe/
此外,每个供应商都有自己特定的 SQL 语言方言。 Sql Server 中的一些习惯用法在迁移到 DB2 时会以不同的方式工作。您将必须重写一些(如果不是大部分)查询。
Yes. Db2 uses a different provider than sql server. So first of all you need find and install that provider (it probably comes with your DB2 installation or is available from IBM) and then change your
SqlClient
namespace references to useIBM.Data.DB2
instead. Also, the class names change. SoSqlCommand
types for example need to be updated to useDB2Command
. This link should help:http://www.ibm.com/developerworks/data/library/techarticle/dm-0502alazzawe/
Additionally, every vendor has their own particular dialect of the SQL language. Some idioms from Sql Server will just work differently when moving to DB2. You will have to re-write some, if not most, of your queries.