In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The process by which wildcards find files in a specified directory:
-find the files in the specified folder (directory). ALTER PROCEDURE [FileS]. [DIR_FileS] @ Path nvarchar (1000)-search path. -- indicates that [folder path] must end with'\';-- indicates that [file path] cannot end with\. (the file name can be wildcard), @ FileS nvarchar (MAX) OUTPUT-returns the string of file names found, @ Depth int=1-- searches for the depth of the [folder]. If not 1, [subfolder] will be searched. 0 all directories, 1 level 1 directory, 2 level 2 directory, and so on, @ FG nvarchar (10) = NULL-- the delimiter of the filename string; default char (13) ASBEGIN SET NOCOUNT ON; SET @ FG=ISNULL (@ FG,char (13));-- delimiter The default char (13) IF @ Depth0 AND SUBSTRING (@ Path,@i,1)'\ 'BEGIN--' SET @ iConstructive1; END; IF @ I > 0 BEGIN-intercepts the filename SET @ FileName=SUBSTRING (@ Path,@i+1,LEN (@ Path)) SET @ Path = SUBSTRING (@ Path,1,@i-1);-- convert wildcard SET @ FileName=replace (@ FileName,'*','%'); SET @ FileName=replace (@ FileName,'?','_'); END; END -- print'@ Path='+ISNULL (@ Path,'') +'@ FileName='+ISNULL (@ FileName,''); insert @ Tab exec master..xp_dirtree @ Path, @ Depth-- search depth: 0 all directories, 1 first level directory, 2 second level directory, and so on, 1 -- 0 folder, non-0: folder and file name-- Delete mismatch records IF ISNULL (@ FileName,'')''BEGIN-- select [FileName] from @ Tab WHERE [isfile] = 1 AND [FileName] like @ FileName; DELETE @ Tab WHERE [isfile] 1 OR [FileName] not like @ FileName; END ELSE DELETE @ Tab WHERE [isfile] 1;-- assemble the file name string Add the delimiter @ FG SET @ FileS=''; SELECT @ FileS=@FileS+@FG+ISNULL ([FileName],'') FROM @ Tab; IF @ FileS''BEGIN-- remove the first separator @ FG IF SUBSTRING (@ FileS,1,LEN (@ FG)) = @ FG BEGIN; SET @ FileS=SUBSTRING (@ FileS,LEN (@ FG) + 1M Len (@ FileS)) END; END; END1:-- print'@ FileS='+@FileS;-- select [FileName] from @ Tab;END
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Step 1: select SessionOption from the Option menu.
© 2024 shulou.com SLNews company. All rights reserved.