| 
	
 | 
 Posted by Erland Sommarskog on 02/28/07 22:37 
(Utahduck@hotmail.com) writes: 
> INSERT INTO #Files 
> EXEC sp_GetFileNames @Path = '\\isoft2\ftp\Legacy\Billing\', @Wildcard 
>= '*.txt' 
 
Note that the sp_ prefix is reserved for system procedures, and SQL Server 
will first look for these in the master database. Do not use it for your 
own code. 
 
> When I run this I get: 
>  
> Server: Msg 8164, Level 16, State 1, Procedure sp_GetFileNames, Line 
> 53 
> An INSERT EXEC statement cannot be nested. 
>  
> Because I use an INSERT EXEC to with the results from the @Cmd. 
>  
> Anybody have any ideas how I can get that information into a table? 
  
I have an article on my web site that discusses a couple of alternatives: 
http://www.sommarskog.se/share_data.html. 
 
 
--  
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se 
 
Books Online for SQL Server 2005 at 
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx 
Books Online for SQL Server 2000 at 
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
 
  
Navigation:
[Reply to this message] 
 |