Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 How to run a stored procedure?

Author  Topic 

rardales
Starting Member

32 Posts

Posted - 2004-12-22 : 13:08:35
Hi, guys. I'm new here and I'm still learning how to be a dba at my work. I have been instructed by the developers to run a stored procedure called p_bank_account. I also need to disable the triggers on the table before doing so. My question is, what is the correct sql syntax to run the stored procedure? I'd appreciate your help. Thanks.

Kristen
Test

22859 Posts

Posted - 2004-12-22 : 13:17:28
MyStoredProcedureName [... list of parameters, if any ...]

will do.

If its a statement WITHIN a multi-statement block you need (and IMO this is "better" syntax):

EXEC MyStoredProcedureName [... list of parameters, if any ...]

and it would be wise to specify the owner of the SProc:

EXEC dbo.MyStoredProcedureName [... list of parameters, if any ...]

If you are creating the SProc do NOT name it "sp_xxxx", use some other prefix ("sp_xxx" ones cause SQL to check master first, and if not found then check the current database)

Kristen
Go to Top of Page

cshekar
Starting Member

49 Posts

Posted - 2004-12-22 : 13:32:30
Here is the syntex you got do

first disabel trigger
ALTER TABLE dbo.Currhold DISABLE TRIGGER ALL

EXEC nameofProc

ALTER TABLE dbo.Currhold ENABLE TRIGGER ALL

That al you have do you will be fine




chandra shekar
Go to Top of Page

rardales
Starting Member

32 Posts

Posted - 2004-12-22 : 15:26:03
Thanks guys. It worked. I appreciate your help.
Go to Top of Page
   

- Advertisement -