In SQL Server you can use the OBJECTPROPERTY() function to check an object’s type. More specifically, you can check whether it is or isn’t a specific type.
For example, the IsTable property tells you whether or not it’s a table, the IsView property tells you whether or not it’s a view, etc.
This article offers a few basic examples that check whether an object is a table, view, stored procedure, or table-valued function.