问题
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...
回答1:
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
.
回答2:
Just press CTRL + 0 (why should the answer body longer than 30 cars?)
来源:https://stackoverflow.com/questions/23734371/how-to-enter-null-into-ssms-cell