SQL SERVER 2008 R2 [英] SQL SERVER 2008 R2

查看:115
本文介绍了SQL SERVER 2008 R2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过存储过程将空值插入整数类型列任何正文帮助我的朋友?



例如:ID INT NOT NULL,

NAME NVARCHAR(100)NOT NULL





使用C#和ASP.NET来解决问题任何身体帮助我... ...



谢谢,

ANIL

How to insert a null values into integer type column through stored procedure any body help me friends?

Ex: ID INT NOT NULL,
NAME NVARCHAR (100) NOT NULL


USE C# AND ASP.NET TO SOLVE A PROBLEM ANY BODY HELP ME.....

THANKS ,
ANIL

推荐答案

你可以' 't。

如果您明确说:

You can''t.
If you explicitly say:
ID INT NOT NULL

然后你不能使用存储过程将它的值设置为null或者通过任何其他方式,并告诉SQL该列只能 包含整数值,而不是空值。

唯一的方法是这样做是为了改变列的定义以允许空值:

Then you cannot set it''s value to null using a stored procedure or by any other means, and you have told SQL that the column can only contain intger values, and not nulls.
The only way to do it is to change the definition of the column to allow nulls:

ID INT NULL

但是,给出了tha这是一个ID列,最好将它们保留为NOT NULL,这样就不会有重复...

However, given that this is an ID column, it is probably best to leave them as NOT NULL so that you don''t get duplicates...


这篇关于SQL SERVER 2008 R2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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