Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
In the string i want 1 as the output can anyone suggest me the query DECLARE @STR NVARCHAR(MAX) = 'FURN-348-1SCH-2absf'


What I have tried:

i want data from the second hypen(-).
Posted
Updated 16-Jul-18 1:05am

1 solution

There is not enough information in your question to help you fully.

If this is to be a part of a stored procedure then I would have a read of this SQL Server – How to Write Stored Procedures With Output Parameters?[^]

If I am wrong then please update your question to have as much information as possible about your problem.
 
Share this answer
 
Comments
Member 13913124 16-Jul-18 7:18am    
This is the string 'FURN-348-1SCH-2absf'. in this string I want the data between the Second hypen(-) and third hypen(-).
I want the output 1SCH from the Given string in SQL server.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900