sql-serverssms-2012

How to enter 'NULL' into SSMS cell?


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...


Solution

  • 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.