In SQL Server you can use the OBJECTPROPERTY()
function to find out whether or not an object is a stored procedure.
This function accepts two parameters: the object ID, and the property for which you’re checking it for.
Therefore, you can pass the object ID as the first argument, and IsProcedure
as the second, and the function will return either a 1
or a 0
depending on whether or not it’s a stored procedure.
A return value of 1
means that it is a stored procedure, and a value of 0
means that it’s not.