SQL语句插入 smallint 类型的数据 本帖最后由 hc1104 于 2011-09-10 00:55:54 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 create table tb(stu_ID varchar(8),stu_Year smallint)goinsert into tb values('001',3)select * from tbdrop table tb/*stu_ID stu_Year -------- -------- 001 3(所影响的行数为 1 行)*/ 你的插入语句,最好把001 -- > '001',否则就成如下了.create table tb(stu_ID varchar(8),stu_Year smallint)goinsert into tb values('001',3)INSERT INTO tb VALUES(001,3)select * from tbdrop table tb/*stu_ID stu_Year -------- -------- 001 31 3(所影响的行数为 2 行)*/ 注意你的stu_ID数据类型,字符串插入要加引号。 insert into tb values('001',3) 引号加了..为什么还是不行..如果我只操作这2列的数值没问题.但是多了 就出问题了.INSERT INTO student_Info (student_ID,student_Name,student_Sex,born_Date,depart_ID,class_NO,tele_Number,entr_Date,stu_Year,edu_bg,address,codeNo,zzmm,comment) VALUES ( 'o111','hc','女','1990-1-1',333,333,222222,'2000-1-1',3,'123', 123,'123','群众','123')stu_Year smallint类型.(0 行受影响)(1 行受影响)(7 行受影响)(1 行受影响) 我在一楼已经帮你测试成功了.再帮你加一列.create table tb(stu_ID varchar(8),stu_Year smallint , tt smallint)goinsert into tb values('001',3 , 1)select * from tbdrop table tb/*stu_ID stu_Year tt -------- -------- ------ 001 3 1(所影响的行数为 1 行)*/自己好好检查一下吧. 插入百万条数据用时25秒?? SQL 统计问题,谢谢 左连接如何加条件where 提问一个简单的问题,请高手指点 关于数据转换高难度问题 installshield 打包安装msde2000 初学SQL-server问个问题~ 求教,关于字段的格式 一个在IB6.5中建表的问题!请大家看看! 輸出數據庫結構 出入库思路 数据库的问题
goinsert into tb values('001',3)select * from tbdrop table tb/*
stu_ID stu_Year
-------- --------
001 3(所影响的行数为 1 行)
*/
goinsert into tb values('001',3)
INSERT INTO tb VALUES(001,3)select * from tbdrop table tb/*
stu_ID stu_Year
-------- --------
001 3
1 3(所影响的行数为 2 行)
*/
为什么还是不行..
如果我只操作这2列的数值没问题.但是多了 就出问题了.
INSERT INTO student_Info (student_ID,student_Name,student_Sex,born_Date,depart_ID,class_NO,tele_Number,entr_Date,stu_Year,edu_bg,address,codeNo,zzmm,comment) VALUES ( 'o111','hc','女','1990-1-1',333,333,222222,'2000-1-1',3,'123', 123,'123','群众','123')
stu_Year smallint类型.(0 行受影响)(1 行受影响)(7 行受影响)(1 行受影响)
再帮你加一列.
create table tb(stu_ID varchar(8),stu_Year smallint , tt smallint)
goinsert into tb values('001',3 , 1)select * from tbdrop table tb/*
stu_ID stu_Year tt
-------- -------- ------
001 3 1(所影响的行数为 1 行)
*/自己好好检查一下吧.