简体   繁体   English

SQL Server存储过程/查询的说明

[英]explanation of SQL Server stored procedure / query

I was hoping someone could explain this snippet of a SQL Server 2005 stored procedure its part of a select query - I am competent in php mysql but ASP / SQL Server is not my forte! 我希望有人可以解释这个SQL Server 2005存储过程的片段,它是一个选择查询的一部分 - 我能胜任php mysql,但ASP / SQL Server不是我的强项!

+RTRIM(ISNULL(r.country,''))+'|'
+RTRIM(ISNULL(r.phone,''))+'|'
+RTRIM(ISNULL(r.fax,''))+'|'
+dbo.UKBN(RTRIM(ISNULL(r.bn,'')))+'|'
+RTRIM(ISNULL(r.bn,''))+'|'
+RTRIM(ISNULL(CAST (r.eventid AS varchar(5)),''))
)

I understand it takes db vars resets them if they are null to '' and trims them, then concatenates them together pipe separated. 我理解,如果它们为''并且修剪它们,则将db变量重置为它们,然后将它们连接在一起进行管道分离。

This is the bit I don't get 这是我没有得到的

+dbo.UKBN(RTRIM(ISNULL(r.bn,'')))+'|'

It seems to check if r.bn is null then resets to '' if so, then performs a trim, but then I do not understand what dbo.UKBN is / does???? 它似乎检查r.bn是否为null然后重置为''如果是,然后执行修剪,但后来我不明白dbo.UKBN是什么?

It does not seem to be a table / var or another stored procedure - can someone explain what it is likely to be / do in this layout. 它似乎不是表/ var或其他存储过程 - 有人可以解释它在此布局中可能/做的事情。

dbo.UKIPBN is a scalar user defined function. dbo.UKIPBN是标量用户定义函数。 In Management Studio look under Programmability -> Functions -> Scalar-Valued Functions to find it. 在Management Studio中查看Programmability -> Functions -> Scalar-Valued Functions以查找它。

dbo.UKIPBN is a user defined function. dbo.UKIPBN是用户定义的函数。 And it is scalar valued function. 它是标量值函数。 Try Programmability -> Functions -> Scalar-Valued Functions to find it. 尝试Programmability -> Functions -> Scalar-Valued Functions来查找它。

dbo.UKBN将是用户定义的函数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM