I am updating from SQL 2005 to SQL Server 2012 R2.
I have an old function that apparently isn't compatible with SQL Server 2012.
What do I need to do to the below code, to make it work in SQL 2012?
create function [dbo].[getChildren](@parent varchar(25))
returns table as return
with result(ItemChild) as
(select ItemChild from AlereBillMaterial where ItemParent=@parent
select t.ItemChild from result r
inner join AlereBillMaterial t on t.ItemParent = r.Itemchild)
select * from result