[转]How to Use xp_dirtree to List All Files in a Folder
Last week I blogged about how to use an undocumented stored procedures to create folders. This week we need to do the opposite. We need to get a list of all files from a subfolder in order to process them. In order to do that, we'll use another undocumented extended stored procedure; master.sys.xp_dirtree. This stored procedure will display a list of every folder, every subfolder, and every file for path you give it.
- directory - This is the directory you pass when you call the stored procedure; for example 'D:\Backup'.
- depth - This tells the stored procedure how many subfolder levels to display. The default of 0 will display all subfolders.
- file - This will either display files as well as each folder. The default of 0 will not display any files.
For today's example, we just want to display all of our backup files (*.BAK) in a particular folder. We need to all of the other parameters in order to show the files as well as any subfolders.
[转]How to Use xp_dirtree to List All Files in a Folder的更多相关文章
- MS SQLServer 批量附加数据库 分类: SQL Server 数据库 2015-07-13 11:12 30人阅读 评论(0) 收藏
************************************************************ * 标题:MS SQLServer 批量附加数据库 * 说明:请根据下面的注释 ...
- SQL注入攻防入门详解
=============安全性篇目录============== 本文转载 毕业开始从事winfrm到今年转到 web ,在码农届已经足足混了快接近3年了,但是对安全方面的知识依旧薄弱,事实上是没机 ...
- Security5:Execute AS 和 impersonate 权限
principal 是统称,包括login,user,role等,可以向作为安全主体的用户授予权限,principal分为server level和database level. 登录名是Server ...
- SQL注入攻防入门详解(2)
SQL注入攻防入门详解 =============安全性篇目录============== 毕业开始从事winfrm到今年转到 web ,在码农届已经足足混了快接近3年了,但是对安全方面的知识依旧薄弱 ...
- sp_MSforeachtable 与 sp_MSforeachdb
在MSSQL里有许多不公开的系统存储过程,其中可能常用的sp_MSforeachtable和sp_MSforeachdb有这2个.分别用于遍历某数据库的每个用户表.每个数据库. sp_MSforeac ...
- Java程序员从笨鸟到菜鸟之(一百零一)sql注入攻击详解(二)sql注入过程详解
在上篇博客中我们分析了sql注入的原理,今天我们就来看一下sql注入的整体过程,也就是说如何进行sql注入,由于本人数据库和网络方面知识有限,此文章是对网上大量同类文章的分析与总结,其中有不少直接引用 ...
- Sql-Server应用程序的高级注入
本文作者:Chris Anley 翻译: luoluo [luoluonet@hotmail.com] [目 录] [概要] [介绍] [通过错误信息获取信息] [更深入的访问] [xp_cmdshe ...
- Windows Sqlserver Automatic Log Audit Via C/C++
catalog . 数据库日志审计产品 . Mysql日志审计 . SQLServer日志审计 1. 数据库日志审计产品 Relevant Link: http://enterprise.huawei ...
- Deformity ASP/ASPX Webshell、Webshell Hidden Learning
catalog . Active Server Page(ASP) . ASP.NET . ASP WEBSHELL变形方式 . ASPX WEBSHELL变形方式 . webshell中常见的编码转 ...
随机推荐
- WinForm如何去掉右边和下边的白边
系统给的窗体样式都缺乏美感,想要漂亮的UI只能自己做,很容易实现 1.新建窗体,设置FormBorder为None 这时的窗体就只有一个Panel(Form自带的默认Panel),没有边框,没有标题栏 ...
- dropdownlist的OnSelectedIndexChanged方法不触发
解决方法: AutoPostBack="true" if (!IsPostBack){ 数据绑定 } 如果数据绑定后不触发,但是手动添加数据的情况下触发<%@ Page En ...
- OpenVswitch mirror 镜像功能
# 从int-br-eth1进入的包镜像一份给dummy0 # 现象:dummy0 可以抓到 int-br-eth1 进入的包 modprobe dummy ip link set up dummy0 ...
- Flask系列03--Flask的路由 app.route中的参数, 动态参数路由
Flask–路由 添加路由的两种方式 第一种 @app.route("/my_de") def detail() 第二种(了解即可) app.add_url_rule(" ...
- django项目中使用项目环境制作脚本 通过终端命令运行脚本文件
在实际的django项目开发中,有时候需要制作一些脚本文件对项目数据进行处理,然后通过终端命令运行脚本. 完整的实现流程如下: 1.在一个应用目录下(app, 必须是在应用目录下,可以专门创建一个应用 ...
- C/C++ 语言 Hello world
#include <stdio.h> void main() { int x,i; ; scanf("%d",&x); if(x>y) printf(&q ...
- FunDA(11)- 数据库操作的并行运算:Parallel data processing
FunDA最重要的设计目标之一就是能够实现数据库操作的并行运算.我们先重温一下fs2是如何实现并行运算的.我们用interleave.merge.either这几种方式来同时处理两个Stream里的元 ...
- 操作实践题 - HTML 列表综合应用
通过对列表的综合应用,编写如下效果网页: 解答: <html> <head> <title>操作实践题</title> <meta http-eq ...
- beyondCompare试用期到期解决办法
找到beyond Compare 4文件夹下面的BCUnrar.dll,将其删掉或者重命名,再重新打开接着使用! 我这是转的,到期之后试试.
- gitlab改变服务器ip
一./home/git/gitlab/config/unicorn.rb 其中的ip需要修改,否则unicorn无法启动. 二./home/git/gitlab-shell/config.yml 其中 ...