SQL Error (3621): String or binary data would be truncated The statement has been terminated. */

一.问题SQLServer数据库写入的时候出现了错误如下:

 SQL Error (3621): String or binary data would be truncated The statement has been terminated. */

二.原因

数据库表结构中字段定义的长度比实际要写入的字段内容的长度小,所以无法写入

 三.解决方案

重新修改了表结构字段的长度后就可以成功写入了

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
下面这段代码是什么意思?/* Maximum length of a string read from the Configuration file (/etc/cyusb.conf) for the library. */ #define MAX_CFG_LINE_LENGTH (120) /* Maximum length for a filename. */ #define MAX_FILEPATH_LENGTH (256) /* Maximum size of EZ-USB FX3 firmware binary. Limited by amount of RAM available. */ #define FX3_MAX_FW_SIZE (524288) static struct cydev cydev[MAXDEVICES]; /* List of devices of interest that are connected. / static int nid; / Number of Interesting Devices. */ static libusb_device *list; / libusb device list used by the cyusb library. */ /* struct VPD Used to store information about the devices of interest listed in /etc/cyusb.conf / struct VPD { unsigned short vid; / USB Vendor ID. / unsigned short pid; / USB Product ID. / char desc[MAX_STR_LEN]; / Device description. */ }; static struct VPD vpd[MAX_ID_PAIRS]; /* Known device database. / static int maxdevices; / Number of devices in the vpd database. / static unsigned int checksum = 0; / Checksum calculated on the Cypress firmware binary. */ /* The following variables are used by the cyusb_linux application. / char pidfile[MAX_FILEPATH_LENGTH]; / Full path to the PID file specified in /etc/cyusb.conf / char logfile[MAX_FILEPATH_LENGTH]; / Full path to the LOG file specified in /etc/cyusb.conf / int logfd; / File descriptor for the LOG file. / int pidfd; / File descriptor for the PID file. */ /* isempty: Check if the first L characters of the string buf are white-space characters. */ static bool isempty ( char *buf, int L) { bool flag = true; int i; for (i = 0; i < L; ++i ) { if ( (buf[i] != ' ') && ( buf[i] != '\t' ) ) { flag = false; break; } } return flag; }
07-12
这段代码是一个C语言程序,它定义了一些常量和结构体,并实现了一个名为"isempty"的函数。 首先,它定义了一些常量,包括从配置文件中读取字符串的最大长度MAX_CFG_LINE_LENGTH、文件名的最大长度MAX_FILEPATH_LENGTH,以及EZ-USB FX3固件二进制文件的最大大小FX3_MAX_FW_SIZE。 接下来,它定义了一个结构体cydev,用于存储连接的设备信息。还定义了一个整数nid,表示感兴趣的设备数量。同时,还定义了一个libusb_device类型的变量list,用于存储libusb设备列表。 然后,定义了另一个结构体VPD,用于存储在/etc/cyusb.conf配置文件中列出的感兴趣设备的信息,包括USB Vendor ID、USB Product ID和设备描述等字段。并且声明了一个VPD类型的数组vpd,用于存储已知设备的数据库,并定义了一个整数maxdevices,表示vpd数据库中设备的数量。此外,还声明了一个unsigned int类型的变量checksum,用于计算Cypress固件二进制文件的校验和。 接下来,定义了一些变量,包括pidfile、logfile、logfd和pidfd等,这些变量在cyusb_linux应用程序中使用,并表示PID文件和LOG文件的路径以及文件描述符。 最后,定义了一个名为"isempty"的静态函数。该函数用于检查字符串buf的前L个字符是否为空格或制表符,并返回一个布尔值,指示字符串是否为空。该函数用于检查字符串是否为空白,以便进行进一步处理。 总体来说,这段代码定义了一些常量、结构体和变量,并实现了一个函数,用于对字符串进行检查。它可能是某个C语言程序的一部分,用于处理与CyUSB相关的操作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值