title: Can we call function inside an function SQL Server 2005
body: <pre><code>ALTER function [dbo].[getEmployeeID](@ID int) returns table
  as  
    begin
    return (
      select * from [dbo].[gtEmployeeName](2)
      select * from Employees where EmployeeID = @ID)
  end
  </code></pre>
  
  <p>here <code>[dbo].[gtEmployeeName]</code> is an other function that I am trying to call.</p>
  
  <p>I am getting an error,  can we call or is there any syntax problem?</p>
  
  <blockquote>
    <p>Msg 156, Level 15, State 1, Procedure getEmployeeID, Line 6<br>
    Incorrect syntax near the keyword 'select'.<br>
    Msg 102, Level 15, State 1, Procedure getEmployeeID, Line 6<br>
    Incorrect syntax near ')'.</p>
  </blockquote>
  
  <p>Thanks
  Prince</p>