title: How can I get a row count from all tables based on specific criteria
body: <p>I can get the row count of all tables using this query.</p>
  
  <pre><code>    SELECT '[' + SCHEMA_NAME(t.schema_id) + '].[' + t.name + ']' AS fulltable_name, SCHEMA_NAME(t.schema_id) AS schema_name, t.name AS table_name,
      i.rows
      FROM sys.tables AS t INNER JOIN
      sys.sysindexes AS i ON t.object_id = i.id AND i.indid &lt; 2
  
  **AND
  t.name.programID = 4**
  </code></pre>
  
  <p>but I need to count all rows where programID = n
  I keep getting the following error when adding the bolded line to the where clause</p>
  
  <p>Cannot call methods on nvarchar.
  Any help is greatly needed an appreciated
  Andy</p>