Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking If A Proc Exists
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01245040
Message ID:
01245048
Vues:
23
Yes
... @sproc nvarchar(100)
...
WHERE id = object_id(@sproc)
...
>
>Can I make that a call to a SPROC, passing the proc name I want to check?
>
>
>
>
>>
>>IF exists (SELECT * from dbo.sysobjects
>>	WHERE id = object_id(N'dbo.sp_MyProc')
>>		and OBJECTPROPERTY(id, N'IsProcedure') = 1)
>>
>>>I can't seem to get this syntax right:
>>>
>>>
>>>USE SC
>>>GO
>>>
>>>IF EXISTS(SELECT * FROM SysObjects WHERE Id = "sp_MyProc")
>>>	DROP PROCEDURE sp_MyProc
>>>
>>>GO
>>>
>>>CREATE PROC sp_MyProc....
>>>
>>>
>>>
>>>What am I doing wrong here?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform