Before I create a column or table in a SQL Server database I want to check if the required table and/or columns exist.
I have searched around and found 2 ways so far.
- Stored procedures, which I don't want to use
- By using the
SqlCommand.ExecuteScalar()
method and catching an exception to determine if the table/column exists, which for me is a work around but not a perfect solution.
Is there another way to check if table/column exists in SQL Server?