代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
MSSQL
】
SQL Server 获取所有表和数据的批量操作
作者:
Dezai.CN
/ 发布于
2011/8/13
/
753
<div><span class="Apple-style-span" style="color: rgb(75, 75, 75); font-family: verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; ">1、创建数据库</span><span class="Apple-style-span" style="color: rgb(75, 75, 75); font-family: verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; "> <div class="cnblogs_code" style="box-sizing: border-box; background-color: rgb(245, 245, 245); font-family: 'Courier New'; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; "> <pre style="margin-top: 0px; margin-bottom: 0px; box-sizing: border-box; "><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">CREATE</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">DATABASE</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> DB001</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 128, 128); ">--</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 128, 128); ">默认路径和大小</span></pre> </div> <p style="box-sizing: border-box; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; ">2、创建用户 <div class="cnblogs_code" style="box-sizing: border-box; background-color: rgb(245, 245, 245); font-family: 'Courier New'; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; "> <pre style="margin-top: 0px; margin-bottom: 0px; box-sizing: border-box; "><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">CREATE</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> LOGIN USER1 </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">WITH</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> PASSWORD </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 128, 128); ">=</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">USER_PW</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); ">;</span></pre> </div> <p style="box-sizing: border-box; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; ">3、修改数据的所有者 <div class="cnblogs_code" style="box-sizing: border-box; background-color: rgb(245, 245, 245); font-family: 'Courier New'; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; "> <pre style="margin-top: 0px; margin-bottom: 0px; box-sizing: border-box; "><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">USE</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> DB001<br style="box-sizing: border-box; "></span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); "> exec</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> sp_changedbowner </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">USER1</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span></pre> </div> <p style="box-sizing: border-box; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; ">4、 设置READ_COMMITTED_SNAPSHOT <div class="cnblogs_code" style="box-sizing: border-box; background-color: rgb(245, 245, 245); font-family: 'Courier New'; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; "> <pre style="margin-top: 0px; margin-bottom: 0px; box-sizing: border-box; "><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">ALTER</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">DATABASE</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">[</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">DB001</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">]</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">SET</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> READ_COMMITTED_SNAPSHOT </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">ON</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "><br style="box-sizing: border-box; "></span></pre> </div> <p style="box-sizing: border-box; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; ">5、获取所有数据库名 <div class="cnblogs_code" style="box-sizing: border-box; background-color: rgb(245, 245, 245); font-family: 'Courier New'; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; "> <pre style="margin-top: 0px; margin-bottom: 0px; box-sizing: border-box; "><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">Select</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> Name </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">FROM</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> Master..SysDatabases</span></pre> </div> <p style="box-sizing: border-box; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; ">6、获取所有表名 <div class="cnblogs_code" style="box-sizing: border-box; background-color: rgb(245, 245, 245); font-family: 'Courier New'; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; "> <pre style="margin-top: 0px; margin-bottom: 0px; box-sizing: border-box; "><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">select</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> name </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">from</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> sysobjects </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">where</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> type</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 128, 128); ">=</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">U</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "><br style="box-sizing: border-box; "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 128, 128); ">/*</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 128, 128); "><br style="box-sizing: border-box; "> XType='U':表示所有用户表;<br style="box-sizing: border-box; "> XType='S':表示所有系统表;<br style="box-sizing: border-box; "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 128, 128); ">*/</span></pre> </div> <p style="box-sizing: border-box; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; ">7、获取所有字段名 <div class="cnblogs_code" style="box-sizing: border-box; background-color: rgb(245, 245, 245); font-family: 'Courier New'; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; "> <pre style="margin-top: 0px; margin-bottom: 0px; box-sizing: border-box; "><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">Select</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> Name </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">from</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> SysColumns </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">Where</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> id</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 128, 128); ">=</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 255); ">Object_Id</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); ">(</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">TableName</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); ">) </span></pre> </div> <p style="box-sizing: border-box; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; ">8、查看与某一个表相关的视图、存储过程、函数 <div class="cnblogs_code" style="box-sizing: border-box; background-color: rgb(245, 245, 245); font-family: 'Courier New'; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; "> <pre style="margin-top: 0px; margin-bottom: 0px; box-sizing: border-box; "><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">select</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> a.</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 128, 128); ">*</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">from</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> sysobjects a, syscomments b </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">where</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> a.id </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 128, 128); ">=</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> b.id </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 128, 128); ">and</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> b.</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">text</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 128, 128); ">like</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">%TableName%</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span></pre> </div> <p style="box-sizing: border-box; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; ">9、查询某一个表的字段和数据类型 <div class="cnblogs_code" style="box-sizing: border-box; background-color: rgb(245, 245, 245); font-family: 'Courier New'; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; "> <pre style="margin-top: 0px; margin-bottom: 0px; box-sizing: border-box; "><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">select</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> column_name,data_type </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">from</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> information_schema.columns<br style="box-sizing: border-box; "></span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); "> where</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> table_name </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 128, 128); ">=</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> N</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">TableName</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span></pre> </div> <p style="box-sizing: border-box; margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; ">10、获取数据库文件路径 <div class="cnblogs_code" style="box-sizing: border-box; background-color: rgb(245, 245, 245); font-family: 'Courier New'; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; "> <pre style="margin-top: 0px; margin-bottom: 0px; box-sizing: border-box; "><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">select</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 255); ">ltrim</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); ">(</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 255); ">rtrim</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); ">(filename)) </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">from</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> dbname ..sysfiles </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">where</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 255); ">charindex</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); ">(</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">MDF</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); ">,filename)</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 128, 128); ">></span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 0, 0); font-weight: bold; ">0</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "><br style="box-sizing: border-box; "></span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 128, 128); ">or</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "><br style="box-sizing: border-box; "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">select</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 255); ">ltrim</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); ">(</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 255); ">rtrim</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); ">(filename)) </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">from</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> dbname ..sysfiles </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 255); ">where</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); "> </span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 255); ">charindex</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); ">(</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">LDF</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(255, 0, 0); ">'</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(0, 0, 0); ">,filename)</span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 128, 128); ">></span><span style="box-sizing: border-box; font-family: 'Courier New'; color: rgb(128, 0, 0); font-weight: bold; ">0</span></pre> </div> </span></div>
试试其它关键字
同语言下
.
SQL查询 多列合并成一行用逗号隔开
.
查看存储过程修改时间,最近执行时间
.
设置手动批量删除数据库相关进程
.
获取某个表中特定字段的所有字符串形式
.
SQL 如何去除重复的字符串
.
怎么去掉一个字段中的重复数据
.
String 去除空格 回车 换行 水平制表符
.
SQL查询和替换含有回车,空格,TAB
.
SQL SERVER 查询每日新增用户数量、次留数量
.
判断两个字符串是否存在相同的内容
可能有用的
.
SQL查询 多列合并成一行用逗号隔开
.
查看存储过程修改时间,最近执行时间
.
设置手动批量删除数据库相关进程
.
获取某个表中特定字段的所有字符串形式
.
SQL 如何去除重复的字符串
.
怎么去掉一个字段中的重复数据
.
String 去除空格 回车 换行 水平制表符
.
SQL查询和替换含有回车,空格,TAB
.
SQL SERVER 查询每日新增用户数量、次留数量
.
判断两个字符串是否存在相同的内容
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3