Reputation: 93
Hello I am trying to solve this problem
This is what I've got so far but I dont know if its right
Create FUNCTION GetFileName
(
@fullpath nvarchar(260)
)
RETURNS nvarchar(260)
AS
BEGIN
DECLARE @charIndexResult int
SET @charIndexResult = CHARINDEX('\', REVERSE(@fullpath))
IF @charIndexResult = 0
RETURN NULL
I have tried doing that but I dont really know what i'm doing as I am stuck after that code
Upvotes: 0
Views: 628
Reputation: 9855
You'll need to use non-standard SQL to create a recursive query, look into Common Table Expressions.
Upvotes: 1