简体   繁体   English

如何使用vb.net在SQL Server上安装新实例

[英]How to install new instance on SQL Server using vb.net

Is there nay way that my application could create a new instance (say MyInstance) and attach my DB to that, with sa password? 我的应用程序可以通过sa密码创建新实例(例如MyInstance)并将数据库附加到该实例吗?

Please give me vb.net code for it if possible. 如果可能的话,请给我vb.net代码。

Thanks a lot. 非常感谢。

I don't think so! 我不这么认为! You can only create an instance through SQL Server installation, there is no code for that. 您只能通过SQL Server安装来创建实例,没有针对该实例的代码。

The attachment yes can be done through code, you just need to add FOR ATTACH on your CREATE DATABASE command. 是的,可以通过代码完成附件,您只需在CREATE DATABASE命令上添加FOR ATTACH

Can you share why you want to create a new instance? 您能否分享创建新实例的原因? I don't see why this would be necessary on a application. 我不明白为什么在应用程序上需要这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM