--方法1: EXEC xp_dirtree ‘\\172.6.6.6\D$\TEXT\‘,1,1 --方法2: CREATE TABLE #TXT_Name (NAME VARCHAR( 2000)) SET @iSQL=‘DIR \\172.6.6.6\D$\TEXT\ /ON/B >D:\TEST.TXT‘ EXEC master..xp_cmdshell @iSQL,no_output BULK INSERT #TXT_Name FROM ‘D:\TEST.TXT‘ WITH (BATCHSIZE =1000,FIELDTERMINATOR =‘\t‘,FIRSTROW =1,ROWTERMINATOR =‘\n‘,TABLOCK )
时间: 2024-10-12 19:37:55