You are here: Re: User Defined Functions, passing parameters from another udf's results (end result=Crosstab) « MsSQL Server « IT news, forums, messages
Re: User Defined Functions, passing parameters from another udf's results (end result=Crosstab)

Posted by Erland Sommarskog on 10/25/05 13:17

Ken Post (nntp.post@gmail.com) writes:
> Had a table UDF, not Scalar UDF for the function that returned the
> address number and some messed up thinking.
>
> Here's what I've got now, and it works just fine.
>
> SELECT
> Possibles.*,
> dbo.udf_ReturnAddress(FoundPersonID, 1) AS FullAddr1,
> dbo.udf_ReturnAddress(FoundPersonID, 2) AS FullAddr2
> FROM
> dbo.udf_ReturnPossibleDupsForAPerson(@PersonID) Possibles
>
> WAYYYY simpler now.

OK, but what is this udf_ReturnAddress actually doing? Is just doing a
plain lookup with a SELECT statement, like:

BEGIN
RETURN (SELECT FullAddress FROM addresses
WHERE PersonId = @personid AND Adrno = @no)
END

In such case, rewrite into a join for a considerable performance
improvement.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация