sql server - how to get filename without extension using xp_dirtree -
i have used xp_dirtree
list of filenames remote server path folder. files extensions .bak
not want filename extension .bak
for eg:
filename sales_backup_2016_10_09_213002_7679353.bak
needs
sales_backup_2016_10_09_213002_7679353.
i did search many blags no luck.
please can suggest me how this.
thanks.
use left function : if storing result of xp_dirtree
in table column name filename below script you.
select left(filename,len(filename)-3) tablename
Comments
Post a Comment