SQL Server/T-SQL Tutorial/Procedure Function/Drop procedure

Материал из SQL эксперт
Перейти к: навигация, поиск

DROP PROC|PROCEDURE <sproc name>

8> CREATE TABLE Shippers (
9>      ShipperID int NOT NULL ,
10>     CompanyName nvarchar (40) NOT NULL ,
11>     Phone nvarchar (24) NULL
12> )
13> GO
1>
2>
3> INSERT Shippers VALUES(1,"Express","(503) 555-9831")
4> INSERT Shippers VALUES(2,"Package","(503) 555-3199")
5> INSERT Shippers VALUES(3,"Shipping","(503) 555-9931")
6> go
(1 rows affected)
(1 rows affected)
(1 rows affected)
1>    CREATE PROC spShippers
2>    AS
3>       SELECT * FROM Shippers
4>    GO
1>    EXEC spShippers
2>    GO
ShipperID   CompanyName                              Phone
----------- ---------------------------------------- ------------------------
          1 Express                                  (503) 555-9831
          2 Package                                  (503) 555-3199
          3 Shipping                                 (503) 555-9931
(3 rows affected)
1>    drop PROC spShippers;
2>    GO
1>
2>    drop table Shippers;
3>    GO


How to delete or change a stored procedure

5> --
6> --The syntax of the DROP PROC statement
7> --
8> --DROP {PROC|PROCEDURE} procedure_name [, ...]