Create Procedure TestCount (@sztabname varchar (100)) asdeclare @iReccount INTDECLARE @SZSELSQL NVARCHAR (1000)
Set @Szselsql = 'select @ IReccount = count (*) from' @sztabname Execute sp_executesql @ Szselsql, n '@ Ireccount Int out', @ IReccount Output