Sql get file name
Once you learn my business secrets, you will fix the majority of problems in the future. Leave new Nallu. Pinal Dave. Nethaj Ranaweera. Leave a Reply Cancel reply. Exclusive Newsletter Website. Go to mobile version. In this sql tutorial, t-sql developers can find sql codes for extracting file name from fullpath of a file. No matter whether the file path is stored in a sql table column or full filepath is supplied as a sql variable or sql string parameter, sql developers can use either sql functions to parse file name or use sql string functions in order to extract file name.
Here is sample t-sql code that sql developers can use to extract filename from path given as sql string variable or extract filename from path stored in sql table column. Active 4 years, 4 months ago. Viewed times. I know how to grab user, but not sure if it is possible to grab filename.
Anyone know if this is possible? Did you try it? It's just a matter of parsing the file name. But that file name is not inherently available to the database engine during execution - whatever application is used to run that script ssms, sqlcmd, etc. Better yet, simply add logic to the process that creates the script to embed that information in the script in some fashion.
SMor - Thanks, suspected this wasn't possible, but couldn't find a "Nope, you can't do that" anywhere. If you repost what you've said as an answer, I'm happy to mark it as THE answer especially if you can reference something to back up what you say.
Looking this issue up online, I'm seeing several answers that also claim that this isn't possible example — TT. Add a comment.