安装文件安装后如何对SQL Server运行SQL查询 [英] How run SQL query to SQL Server when Setup file install

查看:70
本文介绍了安装文件安装后如何对SQL Server运行SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的会员,
我有个问题.我有一个带有SQL Server数据库的项目.我想制作一个将脚本附加到我的数据库的安装文件.因此,当我在计算机上运行此设置文件时,会在我的SQL Server上自动运行此SQL查询,因此我的数据库会自动创建.


谢谢
Akhilesh Pandit

Dear Member,
I have a problem. I have a project with SQL Server database. I want to make a setup file in which attach script to my database. So when I run this set up file on computer automatically run this SQL query on my SQL Server, so my database create automatically.


Thank you
Akhilesh Pandit

推荐答案

查看针对类似问题创建设置并支持使用VS.NET创建数据库 [在安装.NET应用程序期间创建数据库 [部署您的应用程序和数据库 [
Look at the answers given for the similar question asked here[^].


Have a look at these too:
Creating setup With support for database creation Using VS.NET[^]
Create database during installation of a .NET application [^]
Deploy your Application and Database[^]


据我所知,现有工具无法做到这一点必须制作您自己的安装程序,在该安装程序中您要求用户提供SQL Server的凭据,然后使用ADO.NET连接创建数据库.
As far as I know this cannot be done by existing tools, you''ll have to make your own installer in which you ask the user for the SQL Server it''s credentials then create the database using a ADO.NET connection.


这篇关于安装文件安装后如何对SQL Server运行SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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