September 27, 2019 at 9:40 am
hi,
i have problem with sql server 2017 and 2014 enterprise edition:
if execute this code from management is all right, while if execute with debug, in window immediately, 'test1' retunr blanck or 0.
It's like reading the string up to 256 characters and no more, why?
declare @pippo VARCHAR(MAX) = '55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555999555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555599955555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555999'
SELECT SUBSTRING(@pippo,256,10) as test1
SELECT SUBSTRING(@pippo,100,10) as test2
without debug result
with debug
why?
September 27, 2019 at 9:54 am
can you post the code in text format please - its easier than all of us manually typing it in
MVDBA
September 27, 2019 at 10:20 am
I can't replicate the issue
have you tried
declare @result
select @result=substring(@pippo,256,10)
MVDBA
September 27, 2019 at 10:43 am
are you using visual studio or sql management studio ?
MVDBA
September 27, 2019 at 10:48 am
sql management studio
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply