为数据库生成插入和创建 SQL 的存储过程

发布于 2024-10-09 07:04:18 字数 124 浏览 0 评论 0原文

如何将数据库从一台服务器移动到另一台服务器(我只能使用 mylittleadmin 访问数据库)。就像标题所说,我想“最简单”的方法是使用存储过程生成 SQL。

我在两台服务器上都使用 SQL Server 2008。

How can I move a db from one server to another (I only have access to the database with mylittleadmin). Like the title says, I guess the "easiest" way would be by generating SQL with a stored procedure.

I'm using SQL Server 2008 on both servers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

黑凤梨 2024-10-16 07:04:18

在 codeplex 项目中 Extreme T-SQL 脚本 我编写了 T-SQL 程序来编写表内容的脚本。我刚刚放弃了它的使用,转而使用 ssms 工具包,但后者不适合您。

在 SSMS 或 VS 中使用这些过程时,主要问题是 Microsoft 对 Print-Statements 输出的最大列宽和最大长度有限制。

我无法预测使用 mylittleadmin 时存在哪些此类限制。
这取决于您使用的数据类型和 varchar 长度。编写处理特殊需求的脚本是可能的。

此外,您首先需要一些东西来编写数据库对象的脚本,并且可能很难找到相应的东西,因为大多数人只是将 SSMS 用于此目的。 sp_helptext 可能有助于编写过程脚本。

In the codeplex project Extreme T-SQL Script I have written T-SQL procedures to script the content of tables. I just abandoned its use myself in favor of ssms tools pack, but the later is no option for you.

When using these procedures in SSMS or VS the main problem is that Microsoft has limits on max column width and max length of output from Print-Statements.

I can't predict, which such limits exist when using mylittleadmin.
It depends on which datatypes and which varchar length you are using. Writing scripts that handle special needs is possible.

Further you need something to script the database objects first and it might be difficult to find something for that, as most people just use SSMS for this purpose. sp_helptext might help to script procedures.

御守 2024-10-16 07:04:18

在 SSMS 中,您可以将数据库从一个 SQL Server 实例复制或移动到另一个实例。您可以右键单击 SSMS 中的数据库,选择“任务”,然后选择“复制数据库”...

或者,当然,您可以简单地备份数据库并在目标服务器上恢复。

(我不知道你提到的“myLitleAdmin”是什么)

In SSMS, you have the ability to copy or move a database from one instance of SQL Server to another. You can right-click on the database in SSMS, choose Tasks and then Copy Database...

Or, of course, you can simply backup the DB and restore on your target server.

(I have no idea what 'myLitleAdmin' is that you referred to)

雨的味道风的声音 2024-10-16 07:04:18

您不需要创建存储过程。最简单的方法是右键单击数据库 --> 任务 --> 备份并创建备份。

之后您可以在另一台服务器上恢复数据库。

You dont need to make a stored procedure. The easiest way to do it is by right click on your database -->task-->back up and create a backup.

after that you can restore your database on the other server.

波浪屿的海角声 2024-10-16 07:04:18

如果您有 myLittleAdmin 的许可证,请按照他们的网站说明进行操作。它说

“购买许可证将为您提供无限的邮件支持。
将您的请求发送至[电子邮件受保护]"

If you have a license for myLittleAdmin then do as their web states. It says

"Purchasing a license gives you unlimited mail support.
Send your request at [email protected]"

黑寡妇 2024-10-16 07:04:18

实际上我发现你可以在 myLittleAdmin 中备份数据库。然后将生成的 .bak 文件作为链接通过电子邮件发送给我。

感谢您的评论,对其中一些进行了投票:)

Actually I found out that you could make a backup of the database in myLittleAdmin. The resulting .bak file was then emailed to me as a link.

Thanks for the comments though, voted up some of them :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文