如何在SSMS单元格中输入"NULL"? [英] How to enter 'NULL' into SSMS cell?
问题描述
在SQL Server Management Studio 2012中,我正在将数据键入/粘贴到表中(通过编辑前200行").
每当我在单元格中键入/粘贴NULL
时,都会插入一个NULL
值.显然,它认为我的意思是NULL
值而不是'NULL'
文本.这行不通,因为我的专栏不可为空...
现在如何在单元格中输入'NULL'
文本?
如果要插入NULL
值,则可以按 Ctrl + 0 ...
只需将'NULL'
(带有单引号)输入到单元格中,SSMS就会剪裁开头和结尾的单引号并将其另存为字符串'NULL'
./p>
没有单引号,SSMS会将输入视为NULL
.
In SQL Server Management Studio 2012, I was typing/pasting data into a table (via Edit Top 200 Rows).
Whenever I typed/pasted NULL
in a cell, a NULL
value was inserted. Apparently it thought I meant the NULL
value instead of the 'NULL'
text. Which didn't work, as my column wasn't nullable...
Now how do I enter the 'NULL'
text into a cell?
If I wanted to insert the NULL
value, I would have pressed Ctrl+0...
Just enter 'NULL'
(with single quote mark) into cell, SSMS will trim leading and ending single quote mark and save it as string 'NULL'
.
Without single quote mark, SSMS will treat input as NULL
.
这篇关于如何在SSMS单元格中输入"NULL"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!