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 |
patshaw
Posting Yak Master
177 Posts |
Posted - 2009-02-24 : 16:59:00
|
I have a variable which holds the full path to a file. ie:\\MyFTP\D$\Loads\File1.csv or \\MyFTP\D$\Loads\File55.csvThe file name is not static and the full path is generated and held in the variable at runtime.From an expression, how can I strip out just the filename to put into another variable? ie.File1orFile55Thanks. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-25 : 10:14:29
|
use SUBSTRING function along with FINDSTRING to get position of \. something likeRIGHT(@[User::variable],FINDSTRING(REVERSE(@[User::variable]),"\",1)-1) |
 |
|
|
|
|