I have the following function
ALTER FUNCTION [dbo].[ActualWeightDIMS]
(
-- Add the parameters for the function here
@ActualWeight int,
@Actual_D
Try casting the ints to varchar, before adding them to a string:
SET @ActualWeightDIMS = cast(@Actual_Dims_Lenght as varchar(8)) +
'x' + cast(@Actual_Dims_Width as varchar(8)) +
'x' + cast(@Actual_Dims_Height as varhcar(8))
Cast the integers to varchar first!
There are chances that you might end up with Scientific Number when you convert Integer to Str... safer way is
SET @ActualWeightDIMS = STR(@Actual_Dims_Width); OR
Select STR(@Actual_Dims_Width) + str(@Actual_Dims_Width)
I was tried the below query it's works for me exactly
with cte as(
select ROW_NUMBER() over (order by repairid) as'RN', [RepairProductId] from [Ws_RepairList]
)
update CTE set [RepairProductId]= ISNULL([RepairProductId]+convert(nvarchar(10),RN),0) from cte