Ver originalSET @qry = 'select count(*)as total from db.'+ @Tabla + ' where Fecha=' +@FechaSELECT @Registros=total FROM OPENQUERY(localhost, @qry)