>that is what i asked u. :)
>
>i have written the sp like this
>
>CREA PROCEDURE XXX
> @TABLE_NAME VARCHAR(50)
>AS
>SELECT * FROM @TABLE_NAME
>
>EXEC XXX 'INV_MAST'
>
>where INV_MAST is the table name.
>
>whenever i try to execute this procedure it gives me error message.
I tried to prevent you from shooting yourself in the foot:) Check sp_executesql.
Cetin