Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Passing a field from a query into a function
 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  
 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.02 seconds. Powered By: Snitz Forums 2000