create table node(id int not null primary key ,Name varchar not null,age varchar not null,birthday datetime not null);insert into node values(001,'xruiqi',24,'1981-11-28 4:22:33')
declare @t table(date datetime) insert into @t select getdate() insert into @t select '2007-07-08 16:09:36.920'select * from @t
新建的SQL群 19078538 欢迎大家加入,共同研究,一起进步!
象这样的字符串,就可以插入到datetime字段中: '2007/01/23'
LZ的SQL语句没有什么大问题,INSERT INTO语句 是对的错在CREATE TABLE时有问题, create table node(id int not null primary key ,Name varchar(10) not null,age varchar(10) not null,birthday datetime not null);定义varchar没有指定长度
insert into @t select getdate()
insert into @t select '2007-07-08 16:09:36.920'select * from @t
'2007/01/23'
create table node(id int not null primary key ,Name varchar(10) not null,age varchar(10) not null,birthday datetime not null);定义varchar没有指定长度