How to check if database table exists when the table has 0 rows?

How to check if database table exists when the table has 0 rows?

EDITED FOLLOWING FEEDBACK.

EDITED FOLLOWING FEEDBACK.

In the following code "exist" should == 1 if the table exists in the database. However, it is returning 0 for me, even though the table exists in the database. I am not sure why this is happening?

Thanks:

foreach (var row in calcSched)
            {
                var dif3 = new DataInterfaceFactory(DatabaseTypes.SqlServer, row.DatabaseName, row.ServerName);
                //var dbName = m_api.Database.ExecuteQuery<CALCULATION_SCHEDULE>("SELECT CONCAT(c.SERVER_NAME, '.', c.DATABASE_NAME)");// concat server name and DB name

            using (DataReader dr2 = dif3.GetDataReader())
            {
                dr2.ExecuteReader("SELECT COUNT(1) AS TABLECOUNT2 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'PMS_CAL_SCHEDULE'");
                var exists = Convert.ToInt32(dr2["TABLECOUNT2"]);
                CommandExecutor CE = dif3.GetCommandExecutor();

                try
                {
                    if (exists == 0)//if table doesn't exist create it
                    {
                        string sql = "CREATE TABLE dbo.PMS_CAL_SCHEDULE(CALCULATION_SCHEDULE_UID INT, USER_UID INT, SCHEDULE_DATE DATE, PMS_CALC_STATUS_UID INT, CALCULATION_START_DATE DATE, CALCULATION_END_DATE DATE, STATUS_MESSAGE CHAR(100), PROGRESS CHAR(20)";
                        CE.ExecuteNonQuery(sql);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error: could not create PMS_CALC_SCHEDULE");
                }
            }
        }


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

SQL Server Tutorial For Beginners - Learn MS SQL Server with Examples

SQL Server Tutorial For Beginners, Microsoft SQL Server Tutorial, SQL Server Training. Microsoft SQL Server explains all the fundamentals of MS SQL Server with examples. What is DBMS? What is SQL? What is SQL Server? SQL Server Installation

How Containerized SQL Server Makes Development Easier

Managing development databases can be tricky, especially if members of the team want to develop on a Mac or Linux device. In this presentation, we learn how running SQL Server in Docker containers can help ensure a consistent development & testing experience for the entire team.

Python with SQL Server Database

In this article you will learn: How to connect through SQL Server Database using Python? How can we store some information into the SQL Server database using Python? How can we perform an update and delete operations? How we will retrieve stored information from the SQL Server database?