June 14, 2012 at 12:07 pm
How would I go about trimming the followin string, so that I only see the "File"? Everything after the last / will grow or shrink in characters. Any help will be appreciated.
/Folder/File/Name
June 14, 2012 at 11:30 pm
This will also work.
SELECT PARSENAME(REPLACE('/Folder/File/Name', '/', '.'), 1)
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
June 14, 2012 at 11:47 pm
Try this
SELECT PARSENAME(REPLACE('/Folder/File/Name', '/', '.'), 2)
June 15, 2012 at 12:00 am
Sony Francis @EY (6/14/2012)
Try thisSELECT PARSENAME(REPLACE('/Folder/File/Name', '/', '.'), 2)
Looks familiar! 😉
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
June 15, 2012 at 8:00 am
Worked perfect! Thanks for all the help.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply