MSSQL生成整个数据库的SQL脚本的工具 scptxfr.exe
scptxfr.exe的路径要正确
declare @cMd varchar(1000)
set @cmd = 'master.dbo.xp_cmdshell ' +
'''c:\"Microsoft ' +
'SQL Server"' +
'\MSSQL\Upgrade\scptxfr.exe ' +
' /s YourServerName /p YourSAPassword /I /d YourDBName /f ' +
'c:\YourDBName.sql'''
exec (@cmd)
工具参数说明:
SCPTXFR /s <server> /d <database> {[/I] | [/P <password>]}
{[/F <script files directory>] | [/f <single script file>]}
/q /r /O /T /A /E /C <CodePage> /N /X /H /G /Y /?
/s - Indicates the source server to connect to.
/d - Indicates the source database to script.
/I - Use integrated security.
/P - Password to use for 'sa'. Note that login ID is always 'sa'.
If /P not used or if a password does not follow the flag,
a null password is used. Not compatible with /I.
/F - The directory into which the script files should be generated.
This means one file is generated for each category of objects.
/f - The single file in which all script is to be saved.
Not compatible with /F.
/q - Use quoted identifiers in the generated scripts.
/r - Include drop statements for the objects in the script.
/O - Generate OEM script files. Cannot be used with /A or /T.
This is the default behavior.
/T - Generate UNICODE script files. Cannot be used with /A or /O.
/A - Generate ANSI script files. Cannot be used with /T or /O.
/? - Command line help.
/E - Stop scripting when error occurs.
Default behavior is to log the error, and continue.
/C - Indicate the CodePage which overrides the server CodePage.
/N - Generate ANSI PADDING.
/X - Script SPs and XPs to separate files.
/H - Generate script files without header (default: with header).
/G - Use the specified server name as the prefix for the generated
output files(to handle dashes in server name).
/Y - Generate script for Extended Properties (valid for 8.x server
only).
MSSQL生成整个数据库的SQL脚本的工具 scptxfr.exe的更多相关文章
- JAVA 自动生成对应数据库表的JPA代码工具
http://blog.csdn.net/zheng2008hua/article/details/6274659 关键词:JPA 数据库表代码自动生成,JPA代码生成 自动生成对应数据库表的 ...
- Excel生成Oracle数据库表sql工具类
1.解决问题: 开发文档中字段比较多的时候,建表sql(Oracle下划线命名规范)比较麻烦,容易出错~~ (主要是懒) 特意手写一个工具,根据excel字段,生成建表的sql语句. ~~~末尾附Gi ...
- mssql sqlserver两条求和sql脚本相加的方法分享
转自:http://www.maomao365.com/?p=7205 摘要: 下文分享两条sql求和脚本,再次求和的方法分享 /* 例: 下文已知两条sql求和脚本,现需对两张不同表的求和记录再次求 ...
- mssql sqlserver 使用SSMS运行sql脚本的六种方法分享
摘要: 下文讲述五种运行sql脚本的方法,如下所示: 实验环境:sql server 2008 R2 在一次会议讨论中,大家咨询我使用SSMS运行sql脚本的方法,下文我将依次举例讲述sql脚本的运行 ...
- 完整备份和差异备份数据库的SQL脚本
工作中需要创建SQL Job对数据库进行定期备份,现把脚本记录如下. 1. 完整备份: -- FULL declare @filename varchar(1024), @file_dev varch ...
- Mysql数据库导出sql脚本
1. 运行环境Centos mysqldump -h localhost -u root -p etv > ./etv.sql etv 是要导出的数据库名 > 设置导出的路径和文件名
- 常用有效检测数据库运行状态SQL脚本
1.查看数据库中不为 InnoDB 引擎的表 SELECT TABLE_SCHEMA, TABLE_NAME, ENGINE FROM information_schema.TABLES W ...
- 【SQL Server 学习系列】-- 随机生成日期时间的SQL脚本
DECLARE @dt1 DATETIME,@dt2 DATETIME,@a BIGINT,@b BIGINT SET @dt1='2010-01-01'--开始日期 SET @dt2='2010-0 ...
- [SQL SERVER] - 还原数据库备份(SQL脚本),抛出 "System.OutOfMemoryException" 异常之解决
背景 在 Microsoft SQL Server 2016 的查询窗体中,直接还原备份数据库的 SQL 脚本(99MB),抛出 Cannot execute script 异常: 原因 相关资料说: ...
随机推荐
- bzoj1072
还是那句话s<=10 必然想到状压 题目唯一的难点在于怎么转移整除 整除即是mod d=0,我们用f[cur,j]表示选取状况为cur,余数为j的方案数 注意一个数a1a2a3…an (ai表示 ...
- WordPress Comment Attachment插件跨站脚本漏洞
漏洞名称: WordPress Comment Attachment插件跨站脚本漏洞 CNNVD编号: CNNVD-201310-062 发布时间: 2013-10-09 更新时间: 2013-10- ...
- SQL Server select into用法
作用: SELECT INTO 语句从一个表中选取数据,然后把数据插入另一个表中. SELECT INTO 语句常用于创建表的备份复件或者用于对记录进行存档 这个语句会在数据库中用和你所指定的列类型和 ...
- 【转】Xcode7.1环境下上架iOS App到AppStore 流程 (Part 二)
原文网址:http://www.cnblogs.com/ChinaKingKong/p/4964549.html 前言部分 part二部分主要讲解 iOS App IDs 的创建.概要文件的配置.以及 ...
- ECSHOP首页调用指定分类下的商品
转:http://bbs.ecshop.com/thread-1123207-1-1.html 调用某个分类下的商品,方法有很多种的,不过都需要先在后台设置模板那里设置显示和显示条数, 然后在需要调用 ...
- sql getdate() 时间格式设置
Sql Server 中一个非常强大的日期格式化函数常用: Select CONVERT(varchar(100), GETDATE(), 23): 2006-05-16 Select CONVE ...
- SRM 446(1-250pt, 1-500pt)
嗯....今天的500确实比较好 DIV1 250 模拟...略 // BEGIN CUT HERE /* * Author: plum rain * score : */ /* */ // END ...
- chgrp、chown、chmod命令
讲解内容: 权限代号的含义如下: r:读写目录或文件的权限 read w :写入目录或文件的权限 write x :执行目录或文件的权限 -:删除目录或文件的权限 s:特殊权限,更改目录或文件 ...
- hdoj 1541 Stars【线段树单点更新+最大值维护】
Stars Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submi ...
- 微信开发第4章 通过accesstoken获取用户标签管理
通过access_token获取用户标签管理: 1.获取标签列表 调用接口为: http请求方式:GET(请使用https协议) https://api.weixin.qq.com/cgi-bin/t ...