>I am looking at someone elses stored procedure code and they are using @@ in front of their variables instead of @. Is there any good reason to do this. Does this make the parameter global? They said that they need to do this because of Output variables, but I can't understand why. I thought that @@-variables were used for system variables only (like @@rowcount.)
AFAIK, you can't create a global variable. Local variables are created using a @ as the first character. There is nothing to prevent a developer from adding a second @ if they want. It's just a preference.
Output parameters are designated using the OUTPUT keyword so no, @@ doesn't designate a variable as an putput variable.
FWIW, the only double symbol notation I know of that dynamically configures anything is ##. The # symbol designates a temporary table. A table created using this is temporary to the connection that created it. In addition, if it was created within an SP, it automatically goes away when the SP ends. If you use ## when creating it, the temporary table is visible for all connections and doesn't go away until dropped.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao