How to enter 'NULL' into SSMS cell?

狂风中的少年 提交于 2020-02-20 06:26:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!