tsql - Strip off any characters from a string in SQL Server -
I am trying to write a stored procedure that will give the next value on the line.
In my case, I am sending a reference number and stored procedure How do I touch any non-numerical number before comparing the value with my passing value? This is my current process code: If you are using SQLServer, then do the following Another solution is using the function change: MIN and
& gt; Returns the next ref number using . However, the ref table contains 123GF, 256ER, 25GD characters, which gives me an error in converting from
Varchar to
int .
Create process [dbo] .nxprevious @refId integer, @Next on NOCOUNT set as the next bit; Select the @lReturn integer IF (@Next = 1) from the table REF declaration where REF = (select from the REF table) where REF & gt; @refId select any other from the table REF Where REF = ( Selection of MAX (REF) [REF-REF & LT; @refId] @lReturn = @@ ROWCOUNT Return @lReturn End GO
Select replacement (reference, 'A', '') from the table -
Comments
Post a Comment