I am trying to write a simple stored proc which takes three arguments \'database name one\', \'database name two\' and \'table name\'. The sql will then perform a row count
You'd have to use dynamic sql, and concatenate the table name into the SQL string to then execute via sp_executsql:
select @sqlstring = 'select @numrowsOUT = count(*) from ' + QUOTENAME(@tablename) EXECUTE sp_executesql ....