如何將exec執行后回傳的結果放置在 select ..from 陳述句中
declare @path varchar(1000) , @exec varchar(2000)
set @path = 'D:\test'
set @exec = 'exec master..xp_cmdshell'+''''+'dir /b '+''+@path+''''
--select @exec
select newid() as ID ,getdate() as DT, @exec as FILES , t.flag as Fname
from Test t
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/87609.html
標籤:基礎類
