将空值插入表中的datetime数据类型 [英] insert null value to datetime datatype in table

查看:220
本文介绍了将空值插入表中的datetime数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在表的第四列中插入空值.我的SQL查询是

I want to insert null value in fourth column into table. my sql query is

select @loccode=LocCode from MstLocation where LocName=@location
                insert into InOutRegister values(@loccode,getdate(),convert(varchar, getdate(), 8),'',@remark)

推荐答案

NULL值在哪里? br/> 替换:
And where is a NULL value?
Replace:
insert into InOutRegister values(@loccode,getdate(),convert(varchar, getdate(), 8),'',@remark)


与:


with:

insert into InOutRegister (Field1, Field2, Field3, Field4, Field5) values(@loccode,getdate(),convert(varchar, getdate(), 8),NULL,@remark)


这篇关于将空值插入表中的datetime数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆