How to check if a function exists on a SQL database
-
29-10-2019 - |
Question
I need to find out if a function exists on a database, so that I can drop it and create it again. It should basically be something like the following code that I use for stored procedures:
IF EXISTS (
SELECT *
FROM dbo.sysobjects
WHERE id = OBJECT_ID(N'[dbo].[SP_TEST]')
AND OBJECTPROPERTY(id, N'IsProcedure') = 1 )
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow