如何在客户端PC上运行附加的sql数据库脚本 [英] how to run attached sql database script at client side pc

查看:75
本文介绍了如何在客户端PC上运行附加的sql数据库脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将.sql脚本(sql server 2008)附加到了我的vs 2008表单应用程序中.现在如何在客户端PC上运行此脚本以将数据库还原到客户端PC.我已经更改了所有引导程序包以安装.net framework和sql server以实现先决条件.然后现在如何将本地数据库还原到客户端pc.当我去安装我的应用程序时遇到一个问题,我在其中添加了sql bootstrap程序包并在本地PC上成功创建了安装程序,但是当我在客户端PC上安装安装程序时,在安装我的应用程序之前我没有在客户端PC上安装sql server express .请帮助我.

I have attached .sql script(sql server 2008) to my vs 2008 form application.now how can I run this script to client side pc to restore database to client pc. I have changes all bootstraper packages to install .net framework & sql server for prerequisites.Then now how can I restore my local database to client pc. and I got one problem when I goes to install my application in which i have added sql bootstraper package & created setup successfully on my local pc but when I install setup on client pc I does not install sql server express on client pc before installing my application. please help me.

推荐答案

此处存在许多问题:
首先,停止提及客户端PC",这是一个特定术语,意思是正在运行浏览器的PC,通过该浏览器可以查看我的网站".由于您不是在谈论网站应用程序,因此使用此术语会造成混淆,并且可能导致响应缓慢.

其次,您不应在安装中包括SQL Server.有两个原因:
0)您只能出于版权原因分发SQL Server Express-不能分发SQL Server完整版.
1)他们可能已经在网络上安装了SQL Server.如果是这样,那么他们大概会想使用该版本.
2)如果他们确实安装了SQL Server,并且您开始激增SQL Server Express实例,那么您将烦恼数据库管理员...
3)与在用户控制下的多个分散版本相比,备份SQl Server的单个站点的可能性要大得多.
4)对于普通"用户来说,安装和管理Sql Server非常复杂-这不是一个好主意!
5)它将破坏使用SqlServer而不是SqlCE或SQLite的主要优势-多用户访问.如果每个人都安装了自己的SQL Server副本,那么您将拥有数据库的多个副本,每个副本都由一个人使用.这将引起一些混乱,并且(取决于您编写原始数据库的方式)在实现问题时可能需要花费相当大的精力才能组合成一个实例.

要么让用户自己安装相关的SQL Server版本,要么切换到单个用户数据库.
There are a number of problems here:
Firstly, stop referring to "client PC" - that is a specific term meaning "the PC that is running the browser via which my website is being viewed". Since you are not talking about a website application, using this term is confusing and may have contributed to the slowness of a response.

Secondly, you should not include SQL Server in your installation. There are a couple of reasons:
0) You can only distribute SQL Server Express for copyright reasons - not SQL Server full version.
1) They may already have SQL Server installed on the network. If so, then they will presumably want to use that version.
2) If they do have SQL server installed and you start proliferating SQL server Express instances, you are going to annoy the heck out of the database administrator...
3) A single site installation of SQl Server is a lot more likely to be backed up than a number of scattered version under user control.
4) Sql server is quite complex for a "normal" user to install and administer - it is not a good idea!
5) It will destroy the primary advantage of using Sql Server over SqlCE or SQLite - multiuser access. If everyone installs their own copy of SQL server, then you will have multiple copies of your database, each used by a single person. This will cause some confusion, and (depending on how you wrote the original database) may take some considerable effort to combine into a single instance when the problem is realized.

Either get the user to install the relevant SQL Server version himself, or switch to a single user database.


这篇关于如何在客户端PC上运行附加的sql数据库脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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