• Mark Fyffe (11/22/2007)


    Actually my mistake this does work on temp tables but it does not work on variable tables nor does the drop table command. i.e.

    declare @t1 table

    (

    c1 varchar(10)

    )

    insert into @t1 values('chess')

    select * from @t1

    truncate table @t1 -- this will give you an error but using the below commented delete statement

    --would work

    --delete @t1

    select * from @t1

    --Drop table statement below also would give you an error if run.

    --Drop table @t1

    Hi mark,

    This is strange behaviour, and its a good topic, that why this happens so, i'll search about it and then let you know, Meanwhile if u find any reasons for this then do share the solution with us.

    Thanks,
    Prashant