ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 278.2k

Text of value changed by adding 1 when move data to #ff why and how s?

Aug 23 2020 8:30 PM

I work on SQL server 2012 I face issue on #finaltable temp I have value field

when check the value I found it 32-Bit when select and display data from #ff I found it

132-BIT . the idea that it add 1 to text of value

so are there are any thing on statement below affect on Value and change it

on finaltable value is 32-bit
on #ff value is 132-bit
 
I dont know why this happen

so can any one help me how to solve it and why this happen

why add 1 to text
  1. select * INTO #FF  from  (  
  2. SELECT DISTINCT  
  3.   [InputID],PART_ID,[Vendor ID],Manufacturer,[Digi-Key Part No.] ,[Mfr Part No.],[Description],Category,Family ,Obsolete ,[Non-Stock]   
  4.   , [Part_Status],partNumber,CompanyName,DKFeatureName2,[Variant Number],IsUnit,  
  5.   SUBSTRING((  
  6.     
  7.      SELECT  isnull(StarFormat,'') + Value+ isnull(endFormat,'')  
  8.     FROM #FinalTable   
  9.     WHERE ([InputID] = Results.[InputID] and DkFeatureId = Results.DkFeatureId)   
  10.   
  11.     FOR XML PATH(''),TYPE).value('.''NVARCHAR(MAX)')  
  12.          
  13.   ,1,5000) AS Value  
  14. FROM #FinalTable Results  
  15. where StatusId=3  
  16.   
  17. union  
  18. SELECT   
  19.   [InputID],PART_ID,[Vendor ID],Manufacturer,[Digi-Key Part No.] ,[Mfr Part No.],[Description],Category,Family ,Obsolete ,[Non-Stock] ,  
  20.     [Part_Status],partNumber,CompanyName,DKFeatureName2,[Variant Number],IsUnit,Value/*,accepted_value_value Value*/ from #FinalTable where StatusId<>3   
  21.   )T

Answers (1)