I have a function that takes 2 parameters and returns the table Is it possible to use this function in a selection and He shows the 3 columns he gives? This is my query: choose
one of the person thanks a.PersonId, b.Passportnumber, dbo.fn_Passport (a.PersonId) }
For SQL Server 2005+, you can use the APPLY operator
< Select the code> one. PersonID, b.Passportnumber, p.col1, p.col2, p.col3, an external application dbo.fn_Passport (a.PersonId) p I have assumed that column names are For example col1, col2, col3
When you apply CROSS , the function must return 1 or more rows to keep the person record. Apply the OUTER to keep the record in person even if the result of the function is in any rows. Basically, apply the same to the above mentioned task, similar to the External Joyter >
Comments
Post a Comment