简体   繁体   English

如何在没有物理访问的情况下将SQL Server数据库“安装”到远程服务器?

[英]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.

相关问题 C# SQL Server 将远程数据库备份到远程默认备份位置,无需直接访问远程位置? - C# SQL Server backup of a remote database to the remote default backup location without direct access to the remote location? 使用WebForms访问远程SQL Server数据库 - Access remote SQL Server database using webforms 如何将远程SQL Server Express数据库部分复制到本地SQL Server Express数据库? - How to do a partial copy of a remote SQL Server Express database to a local SQL Server Express database? 如何在不使用复制的情况下将本地 SQL 服务器数据库的数据同步到远程 SQL 服务器? - How to synchronize data from local SQL Server database to remote SQL Server without using replication? 在 C# 中,即使用户无权访问物理服务器,我如何打开文件? - In C#, how do I Opening file even if the user do not have right to access the physical server? 是否可以在没有SQL Server的情况下访问.mdf数据库? - Is it possible to access a .mdf database without SQL Server? 在没有SQL Server服务的情况下访问SQL Server数据库 - Access SQL Server database without SQL Server service 如何使用远程桌面连接到SQL Server - How do I connect to SQL Server using Remote Desktop 如何与远程数据库sql服务器建立连接? - How to establish connection to remote database sql server? 如何创建一个简单的Windows窗体来访问SQL Server数据库? - How do I create a simple Windows form to access a SQL Server database?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM