[英]How do I “Install” a SQL Server Database to a Remote Server Without Physical Access?
I have a brand new database on an ISP which I intend to use to build an ASP.NET data-driven website. 我在ISP上有一个全新的数据库,打算用来构建ASP.NET数据驱动的网站。 However, I would like to build the whole thing locally and transplant the database to the ISP.
但是,我想在本地构建整体并将数据库移植到ISP。
I have TCP/IP access (ie I can connect to the remote database directly thru SQL Server Management Studio Express), but I do not have Terminal Services access, as this is a database shared with other users of the ISP. 我具有TCP / IP访问权限(即我可以通过SQL Server Management Studio Express直接连接到远程数据库),但是我没有终端服务访问权限,因为这是与ISP的其他用户共享的数据库。
Is there a simple way to "replicate" my local development database to the remote server? 有没有简单的方法可以将我的本地开发数据库“复制”到远程服务器?
One way is to use something like the Database Publishing Wizard to create an SQL script, and then run that script in SQL Server Management studio in the remote database. 一种方法是使用类似数据库发布向导的方法来创建SQL脚本,然后在远程数据库的SQL Server Management Studio中运行该脚本。
Apparently this is integrated in Visual Studio 2008 (didn't know that before). 显然, 这是集成在Visual Studio 2008中的 (以前不知道)。
I just had a similar problem. 我只是有一个类似的问题。 I downloaded and used the SQL Server Pulishing Wizard.
我下载并使用了SQL Server Pulishing向导。 Can be found here.
可以在这里找到。 You end up with a single script file that you apply to your database and it creates everything including the data.
最后,您将获得一个脚本文件,该脚本文件将应用于数据库,并创建包括数据在内的所有内容。
You could just backup the database on your local server and restore it onto the target server. 您可以只将数据库备份到本地服务器上,然后将其还原到目标服务器上。 This'd be easier if the collation of the two servers were the same, but even that's not a show-stopper.
如果两个服务器的排序规则相同,这会更容易,但是即使那样也不能阻止。 Scripting the database is fine while it's empty, but it gets trickier if you want to move it back and forth once it has data in it.
在数据库为空时编写脚本是可以的,但是如果要在数据库中有数据时来回移动它,就变得很棘手。
How about putting your database in the App_Data folder? 如何将数据库放入App_Data文件夹中? You can create it straight from Visual Studio.
您可以直接从Visual Studio创建它。 It should then auto-mount.
然后应该自动挂载。 Then you should be able to just copy it over with the rest of the files.
然后,您应该能够将其与其余文件一起复制。
Assuming you have FTP access, upload a "COPY ONLY" backup of the database to the server and then use Management Studio express to restore the backup and browse to the file and restore it on the server. 假设您具有FTP访问权限,则将数据库的“仅复制”备份上载到服务器,然后使用Management Studio Express还原备份并浏览到文件并将其还原到服务器上。 Should work ok if the SQL version is compatable.
如果SQL版本兼容,则应该可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.