How can I find out if sp_addextendedproperty
is available before trying to use it in a sql script?
I gather it's not available on Azure.
(I'm working on this bug, if you're interested).
How can I find out if sp_addextendedproperty
is available before trying to use it in a sql script?
I gather it's not available on Azure.
(I'm working on this bug, if you're interested).
Use OBJECT_ID to see of the object exists. The function will return NULL if not:
IF OBJECT_ID(N'sp_addextendedproperty', 'P') IS NOT NULL
EXEC sp_addextendedproperty ...
I don't want to just detect that it is azure in case microsft add/remove this proc from various versions of sql server in the future.
Why not just not use extended properties in the first place?