CREATE PROCEDURE [dbo].[TableRowCount] @tableName text, @count int OUTPUT AS EXEC('SELECT * FROM ' + @tableName) SET @count = @@ROWCOUNT RETURN @count
SELECT COUNT(TableName.TablePK) FROM TableName -- Because SELECT * is a really bad habit
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)