我如何“安装” 将 SQL Server 数据库连接到无需物理访问的远程服务器?
我在 ISP 上有一个全新的数据库,我打算用它来构建 ASP.NET 数据驱动的网站。 但是,我想在本地构建整个系统并将数据库移植到 ISP。
我有 TCP/IP 访问权限(即我可以通过 SQL Server Management Studio Express 直接连接到远程数据库),但我没有终端服务访问权限,因为这是与 ISP 的其他用户共享的数据库。
有没有一种简单的方法可以将本地开发数据库“复制”到远程服务器?
I have a brand new database on an ISP which I intend to use to build an ASP.NET data-driven website. However, I would like to build the whole thing locally and transplant the database to the ISP.
I have TCP/IP access (i.e. 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.
Is there a simple way to "replicate" my local development database to the remote server?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
一种方法是使用类似 数据库发布向导创建 SQL 脚本,然后在远程数据库的 SQL Server Management studio 中运行该脚本。
显然这是集成在Visual Studio 2008中(没有之前就知道了)。
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.
Apparently this is integrated in Visual Studio 2008 (didn't know that before).
我刚刚遇到了类似的问题。 我下载并使用了 SQL Server 发布向导。
可以在此处找到。< /a> 您最终会得到一个应用于数据库的脚本文件,它会创建包括数据在内的所有内容。
I just had a similar problem. I downloaded and used the SQL Server Pulishing Wizard.
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.
将数据库放在 App_Data 文件夹中怎么样? 您可以直接从 Visual Studio 创建它。 然后它应该会自动安装。 然后您应该能够将其与其余文件一起复制。
How about putting your database in the App_Data folder? You can create it straight from Visual Studio. It should then auto-mount. Then you should be able to just copy it over with the rest of the files.
假设您具有 FTP 访问权限,请将数据库的“仅复制”备份上传到服务器,然后使用 Management Studio Express 还原备份并浏览到该文件并将其还原到服务器上。 如果 SQL 版本兼容,应该可以正常工作。
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. Should work ok if the SQL version is compatable.