I use database scripts where I check for a stored procedure, then drop it and create it.
Which of the following would be more effective in verifying and removing SPsOption 1
IF EXISTS(SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[myStoredProc]',N'P')) DROP PROCEDURE dbo.myStoredProc;
Option 2
IF OBJECT_ID (N'dbo. myStoredProc',N'P') IS NOT NULL DROP PROCEDURE dbo.myStoredProc;
I decided to use the second because of obvious reasons, is there any reason I should go for the first option
No, there is no good reason to use sys.object directly. Essentially, using these sys views is discouraged, so if you can avoid it, do it!
, INFORMATION_SCHEMA, , - SQL-92 ( Microsoft, sys. *).
. MSDN , sys.object INFORMATION_SCHEMA, sys , .
Source: https://habr.com/ru/post/1707232/More articles:Will obsolete / clr: oldSyntax be supported in VS2005 and does VS2008 still work with VS2010? - clrHow to load Java stored procedure through JDBC in Oracle 10g? - javaPrototypeJS: выбор видимых элементов - javascriptWhen to use the function of combining streams with a stream? - c ++https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1707231/update-duplicate-varchars-to-be-unique-in-sql-database&usg=ALkJrhjRs1D87bqTya5t7YYaGt7sc0r0LwErlang Implementing a Star Search Algorithm - algorithmWhat are some examples of validate () and reset () methods in Struts 2? - strutsHow can I prevent a keydown event of a form in C # from firing more than once? - c #How to integrate / mix managed and unmanaged code - .netIoC and dynamic objects - dependency-injectionAll Articles