You are here: Re: Reading a directory « MsSQL Server « IT news, forums, messages
Re: Reading a directory

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация