SQL Server silently truncates varchar's in stored procedures
问题 According to this forum discussion, SQL Server (I\'m using 2005 but I gather this also applies to 2000 and 2008) silently truncates any varchar s you specify as stored procedure parameters to the length of the varchar, even if inserting that string directly using an INSERT would actually cause an error. eg. If I create this table: CREATE TABLE testTable( [testStringField] [nvarchar](5) NOT NULL ) then when I execute the following: INSERT INTO testTable(testStringField) VALUES(N\'string which