home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,005 of 19,505   
   Hugo Kornelis to All   
   Re: Can't get table function to work   
   23 Nov 10 00:44:51   
   
   From: hugo@perFact.REMOVETHIS.info.INVALID   
      
   Hi Tom,   
      
   If you need to use values from one table in the joined table   
   expression, you need to use APPLY rather than JOIN. So you use:   
      
   SELECT      t1.nID   
   FROM        table1 AS t1   
   CROSS APPLY dbo.udf_somefunction(t1.nID) AS f;   
      
   Or, if you want to preserve rows that produce an empty resultset in   
   the applied table expression:   
      
   SELECT      t1.nID   
   FROM        table1 AS t1   
   OUTER APPLY dbo.udf_somefunction(t1.nID) AS f;   
   --   
   Hugo Kornelis, SQL Server MVP   
   My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca