如何在SSMS单元格中输入"NULL"? [英] How to enter 'NULL' into SSMS cell?

查看:227
本文介绍了如何在SSMS单元格中输入"NULL"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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屋!

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