In a database we have the full file path for a database field type is nvarchar(255)
and structure/data would look like this:
M:\Blue\Red\Green\Folder\Pink\Purple\Database1.accdb
M:\Blue\Red\Orange\Folder1\Folder2\Folder3\Size\Small\Large\DbTest1232323Test.accdb
My question is, how can I extract only the database name – pull only this out:
- Database1.accdb
- DbTest1232323Test.accdb
Since the name of the database can vary, I can't use just a RIGHT()
function.
Is there a way I can somehow use a wildcard in conjunction with RIGHT()
to say, "Pull everything to the right of the last \
"?