Write a script that uses dynamic SQL to return a single column that represents the number of rows in a particular table in the current database. The script should automatically choose the user base table that appears first. Exclude tables "dtproperties" and "sysdiagrams". Name the column CountOfTable, where Table is the chosen table name (declare a variable for it).