更新具有NULL值的Store Procedure值 [英] Update a Store Procedure value that has NULL value

查看:85
本文介绍了更新具有NULL值的Store Procedure值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个查询,当我运行时,我可以看到应用程序返回的DN值为NULL。供应商建议将其设置为某个值或删除。更新存储过程中现有值或删除的最佳方法是什么?


我正在查询@GUID ="交换服务器的randomvalueGUID"



要解决此问题的任何输入?




问候,Jim MSCS - MCP免责声明:此帖子已提供原则上没有任何保证或担保,也没有赋予任何权利。当您看到答案和有用的帖子时,请点击"投票为有帮助","建议为答案"和/或"标记为答案"

解决方案

如果您想要将其设置为某个值,您可以使用
IsNull


 SELECT ISNULL(ProductName,'NoName'))
FROM Product;

如果要从结果中删除,则需要为where语句添加附加条件以排除空值:

其中ColumnName不为空


Hi,

I have a query and when I run I can see the DN value returned is NULL for the application. The vendor recommended to either set it to some value or delete. What is the best way to either update existing value in store procedure or delete?

I am querying against @GUID = "randomvalueGUID of the exchange server"

Any inputs to fix this?


Regards, Jim MSCS - MCP Disclaimer: This posting is provided AS IS with no warranties or guarantees , and confers no rights. When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

解决方案

If you want to set it to some value you can use the IsNull

SELECT ISNULL(ProductName, 'NoName'))  
FROM Product;  

If you want to remove from the result, you will need to add additional condition for your where statement to exclude null values:

Where ColumnName is not null


这篇关于更新具有NULL值的Store Procedure值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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