Let's say we have the following table:
ID file date
1 \\server\share\folder1\folder2\blah.txt 01/01/2010
2 \\server\share\folder1\folder2\blah2.txt 01/01/2010
3 \\server\share\folder1\blah3.txt 01/01/2010
I need a SQL Stored procedure such that I can get only the file name out of the full UNC - for example:
SELECT getFileName(file) as FileName, date as EntryDate
WHERE date = 01/01/2010
I'm using SQL Server 2005 and 2008.
Thank you all in advanced.