I would like to be able to create a stored procedure that accepts a tablename and returns the count of records in that table.
Something like (except I want one that works):
CREATE PROCEDURE [dbo].[spr_RecordCount_GetByTable] AS
DECLARE @TableName nvarchar
SELECT COUNT(*) FROM @TableName
I have a feeling that SysObjects will be involved although I'm not sure how.
I tried this and it didn't work either:
select count(*) from (select * from sysobjects where sysobjects.[name] = 'tblChemInfo')
Thanks in advance!!!