• Thanks a lot by the way i guess this is also working

    select 'ALTER INDEX '+sys.indexes.name+ ' ON '+sys.tables.name+' rebuild' from sys.indexes,sys.tables

    where sys.indexes.object_id=sys.tables.object_id

    and

    sys.indexes.name is not null