You can use the OBJECTPROPERTY()
function in SQL Server to check whether an object is a user-defined table or not.
To do this, pass the object ID as the first argument, and IsUserTable
as the second argument. The function returns a 1
or a 0
depending on whether or not it’s a user-defined table.
A return value of 1
means that it is a user-defined table, and a value of 0
means that it’s not.