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 |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2008-06-30 : 07:47:27
|
| Hi,I am using the following sql to find out if a particular file exists.How can I modify this query so that I can just pass the extension of the file and not the name?For example, in this example, I just want to see if there is a .txt file present and so do not want to pass the name just the .txtThanksdeclare @ret intdeclare @FilePath varchar(50)select @FilePath='c:\work\filename.txt'declare @tblFile table(FileExists bit, FileIsaDirectory bit, ParentDirectoryExists bit)insert into @tblFileEXEC master.dbo.xp_fileexist @FilePathselect FileExists from @tblFile |
|
|
nathans
Aged Yak Warrior
938 Posts |
|
|
|
|
|