Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "*;1" in TADOStoredProc.ProcedureName value in Delphi?

You may specify TADOStoredProc.ProcedureName in Delphi with the following value:

MSSQLProcedureName;1

But what does meen ";1" in this value?

Thanks for the help!

like image 649
Dmitry Avatar asked Dec 07 '11 18:12

Dmitry


1 Answers

This is an optional value that can be used to specify multiple definitions for the same stored procedure name... I think that the original intention was to allow versioning, but I've never seen it used that way in the wild.

When you don't specify the number in the create procedure statement, it defaults to 1. Some of the various data access layers that call SQL Server will explicitly add the ;1 when executing the stored procedure.

From MSDN:

;*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.

like image 148
Michael Fredrickson Avatar answered Nov 01 '22 19:11

Michael Fredrickson