SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Passing a field from a query into a function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

18 Posts

Posted - 10/08/2013 :  17:27:27  Show Profile  Reply with Quote
select ProductCode from Product p inner join
dbo.uf_C_GetCInv('10-10-2013',p.productcode,0) u on p.productcode=u.productcode

as you can see here I am attempting to use ProductCode from the Product table as a parameter to my tabular function uf_Commissary_GetCWarehouseInv. Why isnt this working?

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 10/08/2013 :  23:57:07  Show Profile  Reply with Quote
you cant pass values like this to a UDF using a join. for that you need to use APPLY operator which is available only from SQL 2005 and above.

See scenario 4


SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000