Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure To See If A File Exists 1

Status
Not open for further replies.

webuser

MIS
Jun 1, 2001
202
US
I know I saw some place a Stored Procedure (It may have been an undocumented one) to find out if a specific file name exists. I guess a documeneted Sproc would be preferable but I'll take anything at this point.

Thanks in advance!!!
 
There is an "undocmented" extended stored procedure named xp_fileexist. The XP syntax is as follows.

Declare @rc int

Exec master.dbo.xp_fileexist
"\\Server\data\Filename.txt",@rc Output

If @rc=1
Print 'Exists'
Else
Print 'Does not exist'

Get more info on "undocmented" extended stored procedures at the following link.


See my SQL Articles page for more links, including "Undocumented Stored Procedures" and "Undocumented DBCC Commands"

Terry L. Broadbent
Programming and Computing Resources
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top