I am using a FileTable in SQL Server 2017 and I am doing a dating system to store files on it. Example:
Filetable directory\2020\1\19 - is today's directory, first the year, then the month, then the day. It all works great but only one thing left, checking whether it exists or not.
This is how I insert a directory:
INSERT INTO FILETBL (name, is_directory, is_archive, path_locator)
VALUES (dirName, 1, 0, pathLocatorDependingOnParent)
It's hard to check for duplicates since the month of January (1) would exist in both 2019 and 2020 for example. Any idea how to check for duplicates while also considering subdirectories?