如何在Sql脚本中替换下面的语句? [英] How Do I Replace The Below Statements In Sql Script?

查看:93
本文介绍了如何在Sql脚本中替换下面的语句?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是前端的代码



Hi here is the code in front end

PatientID = record["PatientID"].ToString() == "0" ? string.Empty : record["PatientID"].ToString(),





因此在数据库程序中我已将患者身份识别为 -





so in db procedure i have taken patient id as -

ISNULL(Convert(Varchar(50),PC.PatientID),'') AS 'PatientID',





我的要求是让病人的身份如下 -



PatientID =记录[PatientID]。ToString(),



那么如何通过对其应用Isnull函数来更改db中的sql过程代码来实现相同目的。



提前感谢



my requirement is to have the patient id like-

PatientID = record["PatientID"].ToString(),

So how can i achieve the same by changing the sql procedure code in db by applying Isnull function to it.

thanks in advance

推荐答案

我从问题中理解的是什么..

如果在存储过程中激活select



那么这将起作用



What I understood from question..
If excuting "select" in stored procedure

then this will work

SELECT  [VendorID], ISNULL(Convert(varchar(50), [PatientID]),'0') AS PatientIDFROM [dbo].[TBL_Vendor]


这篇关于如何在Sql脚本中替换下面的语句?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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