Check with OBJECTPROPERTY function : OBJECTPROPERTY « System Settings « SQL Server / T-SQL Tutorial






5>    CREATE FUNCTION dbo.AveragePrice()
6>    RETURNS money
7>    WITH SCHEMABINDING
8>    AS
9>    BEGIN
10>       RETURN (SELECT AVG(Price) FROM dbo.Titles)
11>    END
12> GO
1>
2>    SELECT OBJECTPROPERTY(OBJECT_ID('AveragePrice'), 'IsDeterministic')
3> GO

-----------
          1

(1 rows affected)
1>
2> drop FUNCTION dbo.AveragePrice;
3> GO








26.20.OBJECTPROPERTY
26.20.1.Returning Information about User-Defined Functions
26.20.2.Using the OBJECTPROPERTY Function to Check Whether a View is Indexable
26.20.3.Check with OBJECTPROPERTY function
26.20.4.Use OBJECTPROPERTY and OBJECT_ID to check the table existance