Posted on: 11/2/2012 2:31:12 AM | Views : 360

I am having a table having (Treeid as int , ParentId as nvarchar(50), ChildId as nvarchar(50) and childLevel as nvachar(50)).  FOR Getting all joining through parentId I have written query which is showing "conversion failed while converting nvarchar data type AA1000 to data type int" . Please check my query and tell me where i did mistake.
-------------------------------------------------------------------------------------------------
ALTER PROCEDURE [dbo].[Sp_GetGenelogy]
@UserID as nvarchar(50),
@limit int
AS
declare @start int
DECLARE @sum nvarchar(MAX)
Declare @Outputid nvarchar(MAX)
Set @Outputid=0;
set @start=0;
set @sum = @UserID;
Exec Spp_GenoalogyArrSeries @UserID,@limit,@start,@sum output
select item from fn_Split(@sum,',')
----------------------------------------------------------------------------------------
alter PROCEDURE [dbo].[Spp_GenoalogyArrSeries]
@U ...

Go to the complete details ...