• Your stored procedure should be working fine. The code below is working on my system.

    use AdventureWorks2008R2;

    go

    create PROC [dbo].[sp_getrecords]

    (

    @TableName varchar(4000)

    )

    AS

    begin

    exec('select * from '+@TableName+'')

    end;

    go

    exec [sp_getrecords] 'DatabaseLog';

    exec [sp_getrecords] 'HumanResources.Department';

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **