• I'd create such a proc in the master db and mark it as a system object so that it could be used in all dbs.

    I'd also at least:

    1) optionally allow multiple table names;

    2) optionally allow a schema name with the table name: you can use PARSENAME() to split them;

    3) optionally allow a row count to be specified: this would be particularly useful for initial testing against a new table.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.