Any help is greatly appreciated. I'm using SQL server 2000 and a have a field that contains a file path like this:
and I'm trying to parse out the directory "releases". The starting position will always be the same, right after: "D:\MailRoomImporter\incoming_documents\" but the directory name and length can change.
So essentially I'm trying to find the field after: "D:\MailRoomImporter\incoming_documents\" and before the next "\"
So far I have:
/* */ FileName,
/* */ CHARINDEX('documents\',FileName,1) +10,
/* */ CHARINDEX('documents\', SUBSTRING(FileName,
CHARINDEX('\', FileName, 1) + 19, 99))
But this is returning some additional characters after releases. Any help is greatly appreciated, thanks!