Skip to content
Advertisement

Getting the sql server default backup folder on Linux with T-SQL

For SQL Server on Windows for getting default backup folder we can use master.dbo.xp_instance_regread:

JavaScript

But for Linux it does not work. Can anyone help with T-SQL approach (I only find SSMS solution here)?

Advertisement

Answer

I’ve never found a non-registry way to get the backup directory reliably in t-sql. I usually just do a replace of /data/ to /backup/ since at default install it’s relation to the data directory is clear. This does not directly answer your question but it’s a working way provided you have not done individual directory customization during install.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement