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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 stored procedure parameter

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 myfile
Exec xp_cmdshell 'dir @path /b /s';
select * from #temp
drop 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 #temp
Exec xp_cmdshell @command;
select * from #temp
drop table #temp



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -