Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
zhshqzyc
Posting Yak Master
240 Posts |
Posted - 2011-06-16 : 11:00:06
|
Hi,Please help me to look at what is wrong?Thanks.Create table #temp(myfile varchar(200))declare @path varchar(400)set @path = 'C:\TEST'INSERT myfileExec xp_cmdshell 'dir @path /b /s';select * from #tempdrop table #temp |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-06-16 : 11:31:40
|
INSERT myfile?myfile is a column.Create table #temp(myfile varchar(max))declare @path varchar(400)declare @command varchar(500)set @path = 'C:\test'set @command = 'dir '+@path+' /b /s'INSERT #tempExec xp_cmdshell @command;select * from #tempdrop table #temp No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|