• 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) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".