【发布时间】:2013-04-09 09:10:57
【问题描述】:
我为organization 表创建Insert 语句,如下所示:
select'Insert into Organizations(Name,ContactPerson,ContactNumber,Mobilenumber)values('''+Nameofthecompany+''+','+Nameofthepersonresponsibleforrecruitment+','+PhoneNumber+','+MobileNumber+''')' from Organization
当我执行这个语句时,我得到了插入语句。但问题是该值为 null 时,它会显示所有列 null。
示例:(在数据库中)
- 姓名:xxxx
- 联系人:zzzz
- 联系电话:444444
- 手机号码:空
所以我的插入语句看起来像:
Null.
我只希望该列提供 null。其他细节正确显示。 sql server有什么办法吗?任何人都帮我...
【问题讨论】:
-
只需使用参数,所有这些都消失了。
标签: sql sql-server-2008 insert