I am trying to do the best practice to remove the characters from the beginning of the string.
In some languages, you can also use without the length parameter, however, length is required in TSQL.
Looking at the following code, what is the best practice? (Hex string variable is length)
DECLARE @SHex VARCHAR (66) SET @sHex = '0x7E260F3DA734AD4BD816B88F485CE501D843DF067C8EDCB8AC7DAD331852E04D' print correct (@ sHex, LEN (@SHex) -2) Print SUBSTRING (@shex , 3, LAN (@ SX) -2) Print Subscriber (@ sHex, 3,65535)
Well, the first is more expressive about your intentions. The final is clearly messy (hard-coded length etc.) I suspect that you first & amp; Second, that's why I use the simplest - right
.
Of course, if you are doing a lot of this, then you can write a UFOfof which uses it - if you change your mind, you have only one place in the mind ... < / P>
Comments
Post a Comment