1

I need to build up a dynamic path from inside an SQL script. It started with something like

select left(
    db_property('File'), charindex (
        DB_PROPERTY ( 'Name' ), db_property('File')
    ) - 1
)

but need to add a subfolder there. For the subfolder, from my understanding, I would need to have the path delimiter so it can run under Windows as well as unixoid systems (and who knows if there will be some other systems somewhere maybe using ? as delimiter ;))

I've checked the db-properties but didn't found anything fitting. Is there a good way to determine the delimiter?

frlan
  • 499
  • 4
  • 26
  • If you're looking for the path of a database file, isn't it already clear which OS the files are on? Just have a version which works for each if you have deployments on both types. – LowlyDBA - John M Dec 15 '14 at 20:47
  • I'd prefer a way to read it from database. Of course I could filter for / or \ inside path, but thinking as not a clean solution. – frlan Dec 15 '14 at 22:46

0 Answers0