String or binary data would be truncated. The statement has been terminated

后端 未结 5 1861
臣服心动
臣服心动 2020-12-29 01:51

I have met some problem with the SQL server, this is the function I created:

ALTER FUNCTION [dbo].[testing1](@price int)
RETURNS @trackingItems1 TABLE (
   i         


        
5条回答
  •  一向
    一向 (楼主)
    2020-12-29 02:39

    Specify a size for the item and warehouse like in the [dbo].[testing1] FUNCTION

    @trackingItems1 TABLE (
    item       nvarchar(25)  NULL, -- 25 OR equal size of your item column
    warehouse   nvarchar(25) NULL, -- same as above
    price int   NULL
    
    ) 
    

    Since in MSSQL only saying only nvarchar is equal to nvarchar(1) hence the values of the column from the stock table are truncated

提交回复
热议问题