title: SQL Server : using table function in stored procedure
body: <p>I have function for combobox.</p>
  
  <pre><code>ALTER FUNCTION [FN.USERNew]
  (   
      @USER_ID INT 
  )
  RETURNS TABLE 
  AS
  RETURN 
  (
  Select  [USER_NAME] , username_Id  From USER
  WHERE USER_ID=@USER_ID
  )
  GO
  </code></pre>
  
  <p>I try to use above function in my stored procedure like below.</p>
  
  <p>However, I get an error </p>
  
  <blockquote>
    <p>Cannot Find either column"dbo" or the user -defined function or aggregate "dbo.FN.USERNew", or name is ambigous."</p>
  </blockquote>
  
  <pre><code>ALTER PROCEDURE DBO.[MY_STORED_PROCEDURE]
  (
      @USER_ID INT,
      @PRODUCT_ID INT
  )
  AS
  BEGIN  
  SELECT 
  
  PRODUCT_ID,
  PRODUCT_NAME
  
  DBO.FN.USERNew(USER_ID) AS PROBLEMHERE
  
  FROM PRODUCT_TABLE
  WHERE PRODUCT_ID=@PRODUCT_ID 
  END
  </code></pre>
  
  <p>So why i can not use my function in my stored procedure ?</p>