I ran into some problems with the SQL server, this is a function I created:
ALTER FUNCTION [dbo].[testing1](@price int) RETURNS @trackingItems1 TABLE ( item nvarchar NULL, warehouse nvarchar NULL, price int NULL ) AS BEGIN INSERT INTO @trackingItems1(item, warehouse, price) SELECT ta.item, ta.warehouse, ta.price FROM stock ta WHERE ta.price >= @price; RETURN; END;
When I write a request to use this function as follows, it gets an error
String or binary data will be truncated. Statement completed
How to solve it? Thanks you
select * from testing1(2)
This is how I create the table
CREATE TABLE stock(item nvarchar(50) NULL, warehouse nvarchar(50) NULL, price int NULL);
sql sql-server
user2098512 Feb 22 '13 at 7:57 2013-02-22 07:57
source share