command.CommandText = "EXEC ManageBlogs;2 '" + blogName + "'";
command.ExecuteReader();
CREATE PROC [ EDURE ] [ owner. ] procedure_name [ ; number ] ;numberIs an optional integer used to group procedures of the same name so they can be dropped together with a single DROP PROCEDURE statement. For example, the procedures used with an application called orders may be named orderproc;1, orderproc;2, and so on. The statement DROP PROCEDURE orderproc drops the entire group. If the name contains delimited identifiers, the number should not be included as part of the identifier; use the appropriate delimiter around procedure_name only.
;number
Is an optional integer used to group procedures of the same name so they can be dropped together with a single DROP PROCEDURE statement. For example, the procedures used with an application called orders may be named orderproc;1, orderproc;2, and so on. The statement DROP PROCEDURE orderproc drops the entire group. If the name contains delimited identifiers, the number should not be included as part of the identifier; use the appropriate delimiter around procedure_name only.
CREATE { PROC | PROCEDURE } [schema_name.] procedure_name [ ; number ]...
Is an optional integer that is used to group procedures of the same name. These grouped procedures can be dropped together by using one DROP PROCEDURE statement. For example, an application called orders might use procedures named orderproc;1, orderproc;2, and so on. The DROP PROCEDURE orderproc statement drops the whole group. If the name contains delimited identifiers, the number should not be included as part of the identifier; use the appropriate delimiter around only procedure_name.
Numbered stored procedures have the following restrictions:
Note:
This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
CREATE PROCEDURE ManageBlogs;1 @Name varchar(50)AS INSERT INTO Blogs (blog_name) VALUES (@Name)GO CREATE PROCEDURE ManageBlogs;2AS SELECT * FROM BlogsGO CREATE PROCEDURE ManageBlogs;3 @Id intAS DELETE FROM Blogs WHERE blog_id = @IdGO
CREATE PROCEDURE ManageBlogs;1
@Name varchar(50)
AS
INSERT INTO Blogs (blog_name) VALUES (@Name)
GO
CREATE PROCEDURE ManageBlogs;2
SELECT * FROM Blogs
CREATE PROCEDURE ManageBlogs;3
@Id int
DELETE FROM Blogs WHERE blog_id = @Id
Exec ManageBlogs -- Error Exec ManageBlogs 'MyBlog' -- Executes ;1 Exec ManageBlogs;1 'MyBlog' -- Executes ;1 Exec ManageBlogs;2 -- Executes ;2 Exec [ManageBlogs];2 -- Executes ;2 Exec [ManageBlogs;2] -- Error
Exec ManageBlogs -- Error
Exec ManageBlogs 'MyBlog' -- Executes ;1
Exec ManageBlogs;1 'MyBlog' -- Executes ;1
Exec ManageBlogs;2 -- Executes ;2
Exec [ManageBlogs];2 -- Executes ;2
Exec [ManageBlogs;2] -- Error
Remember Me
Page rendered at 1/7/2009 1:53:46 AM UTC
Ads Via The Lounge
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.