- 1
- 0
- 约1.56千字
- 约 2页
- 2026-01-28 发布于中国
- 举报
查找文件的语句
CODE:
droptabletmp;
createtabletmp
(
[id][int]IDENTITY(1,1)NOTNULL,
[name][nvarchar](300)NOTNULL,
[depth][int]NOTNULL,
[isfile][nvarchar](50)NULL
);
declare@idint,@depthint,@rootnvarchar(300),@namenvarchar(300)
set@root=f:\usr\--Startroot
set@name=cmd.exe--Findfile
insertintotmpexecmaster..xp_dirtree@root,0,1--
set@id=(selecttop1idfromtmpwhereisfile=1andname=@name)
set@depth=(selecttop1depthfromtmpwhereisfile=1andname=@name)
while@depth1
begin
set@id=(selecttop1idfromtmpwhereisfile=0andid@idanddepth=(@depth-1)orderbyiddesc)
set@depth=(selectdepthfromtmpwhereid=@id)
set@name=(selectnamefromtmpwhereid=@id)+\+@name
end
updatetmpsetname=@root+@namewhereid=1
selectnamefromtmpwhereid=1
查找目录的语句
CODE:
droptabletmp;
createtabletmp
(
[id][int]IDENTITY(1,1)NOTNULL,
[name][nvarchar](300)NOTNULL,
[depth][int]NOTNULL
);
declare@idint,@depthint,@rootnvarchar(300),@namenvarchar(300)
set@root=f:\usr\--Startroot
set@name=donggeer--directorytofind
insertintotmpexecmaster..xp_dirtree@root,0,0
set@id=(selecttop1idfromtmpwherename=@name)
set@depth=(selecttop1depthfromtmpwherename=@name)
while@depth1
begin
set@id=(selecttop1idfromtmpwhereid@idanddepth=(@depth-1)orderbyiddesc)
set@depth=(selectdepthfromtmpwhereid=@id)
set@name=(selectnamefromtmpwhereid=@id)+\+@name
endupdatetmpsetname=@root+@namewhereid=1
selectnamefromtmpwhereid=1
您可能关注的文档
- 加班申请表模板.pdf
- 公出申请单模板.pdf
- 2013年7月高等教育自学考试现代管理学真题.doc
- MSSQL注入SA权限不显错模式下的入侵.docx
- SQL常用内容整理.docx
- 常用命令整理.docx
- 全方位预算全套模板.docx
- 爆款刷销量计划表.xlsx
- 财务分析图标.xlsx
- 工资管理体系套装.xlsx
- 2026年中国窗饰产品市场全景调查与市场供需预测报告.docx
- 2026年中国船舶水下清洗行业深度研究报告:市场需求预测、进入壁垒及投资风险.docx
- 2026年中国船用绞车行业运行态势及十五五盈利前景预测报告.docx
- 2026年中国橱柜行业深度调研报告.docx
- 2026年中国船用绞车市场深度调研及投资前景战略分析报告.docx
- 2026年中国船用配套设备市场发展策略及投资潜力可行性预测报告.docx
- 2026年中国储能材料行业运营态势与投资前景预测分析报告.docx
- 2026年中国储氢材料行业运营现状及发展规划分析报告.docx
- 2026年中国传真机市场深度研究及投资前景咨询报告.docx
- 2026年中国储能变流器(PCS)产业深度评估与发展前景趋势分析研究报告.docx
原创力文档

文档评论(0)