• I ran following on sql server 2008 r2 with no errors . you prbly need to check your sproc definition.

    if exists(select * from sys.objects (nolock) where name = 'UserMidList' and type = 'P')

    begin

    exec('drop proc UserMidList');

    end

    go

    create proc UserMidList as

    select 1,20,100001,NULL,25,NULL,NULL

    union

    select 2,20,100007,NULL,25,NULL,NULL

    union

    select 3,20,100030,NULL,25,NULL,NULL

    union

    select 4,20, 100042,NULL,25,NULL,NULL

    union

    select 5,20,100043,NULL,25,NULL,NULL

    go

    declare @UserMidListTable Table (Id Int,Mid int,ValueMid int,CatParent int, [Enabled] int,LastUpdate Datetime,Company nvarchar(max))

    insert into @UserMidListTable (Id ,Mid ,ValueMid ,CatParent , [Enabled] ,LastUpdate ,Company)

    exec UserMidList

    select * from @UserMidListTable

    go

    select @@version

    -- Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)

    --Jun 17 2011 00:54:03

    --Copyright (c) Microsoft Corporation

    --Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)