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!
+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.
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????
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.
dbo.UKIPBNis a scalar user defined function. In Management Studio look underProgrammability -> Functions -> Scalar-Valued Functionsto find it.