SQL 2005 Express Edition - 安装新实例
寻找一种以编程方式或其他方式将 SQL 2005 Express Edition 的新实例添加到已安装实例的系统中的方法。 传统上,您像我在下面的命令行中一样运行 Microsoft 的安装程序,它就可以解决问题。 在我的安装程序中执行命令不是问题,问题更多的是拖动 40 MB 的 MS-SQL 安装程序,如果已经安装了 SQL Express,我就不需要这些安装程序。 这就是我的安装程序当前执行的内容:
SQLEXPR32.EXE /qb ADDLOCAL=ALL INSTANCENAME=<instancename> SECURITYMODE=SQL SAPWD=<password> SQLAUTOSTART=1 DISABLENETWORKPROTOCOLS=0
我不需要启动此命令的帮助,而是需要添加 SQL 2005 Express 新实例的适当方法,而无需再次实际运行完整的安装程序。
我会详细说明为什么我想这样做,但我只会让每个人感到无聊。 可以说,拥有这种创建新实例的能力,而无需花费时间重新安装 SQL Express 等,这将极大地帮助我部署应用程序及其安装程序。 如果对任何人来说有什么不同的话,我在这个安装项目中使用了 NSIS 和高级安装程序的组合。
Looking for a way to programatically, or otherwise, add a new instance of SQL 2005 Express Edition to a system that already has an instance installed. Traditionally, you run Micrsoft's installer like I am in the command line below and it does the trick. Executing the command in my installer is not the issue, it's more a matter of dragging around the 40 MBs of MS-SQL installer that I don't need if they have SQL Express already installed. This is what my installer currently executes:
SQLEXPR32.EXE /qb ADDLOCAL=ALL INSTANCENAME=<instancename> SECURITYMODE=SQL SAPWD=<password> SQLAUTOSTART=1 DISABLENETWORKPROTOCOLS=0
I don't need assistance with launching this command, rather the appropriate way to add a new instance of SQL 2005 Express without actually running the full installer again.
I'd go into great detail about why I want to do this but I'd simply bore everyone. Suffice to say, having this ability to create a new instance without the time it takes to reinstall SQL Express etc. would greatly assist me for the deployment of my application and it's installer. If makes any difference to anyone, I'm using a combination of NSIS and Advanced Installer for this installation project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
听起来用户实例可能会对您有所帮助。 如果您有 MDF 和 LDF 文件,则可以通过指示 SQL Server Express 启动用户实例并将指定文件附加到该实例来连接到这些文件。
本文http://msdn.microsoft.com/en-us/library/ bb264564.aspx 很好地描述了如何依靠现有的 SQL Server Express 安装在连接期间实例化特定于用户的实例。
希望能帮助到你。
It sounds like a user instance might help you. If you have the MDF and LDF files, you can connect to the files by instructing SQL Server Express to launch a user instance and attach the specified file to that instance.
This artile http://msdn.microsoft.com/en-us/library/bb264564.aspx has a good description of how you can lean on the existing SQL Server Express installation to instantiate a user-specific instance for the duration of your connection.
Hope it helps.
经过数月/数年的研究后,似乎无法完成。 哦,好吧,我想我每次需要新实例时都会重新安装。 我想这是因为每个实例都是它自己的服务。
After months/years of looking into this it appears it can't be done. Oh well, I guess I just reinstall each time I want a new instance. I guess it's because each instance is it's own service.
我不知道如何使用 API 来执行此操作,但如果没有人提供更好的解决方案,您始终可以使用 Process.Start() 按原样执行命令行。
I do not know how to do it with an API, but if no one gives a better solution, you can always use Process.Start() to execute your command line as-is.