Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of the Symbol @@ in SQL Server

Tags:

sql

sql-server

What is the meaning of the symbol @@ in SQL Server?

like image 624
Rakesh Avatar asked Mar 27 '15 06:03

Rakesh


People also ask

What does @@ mean in SQL Server?

In SQL Server, symbol @@ is prefixed to global variables. The server maintains all the global variables.

What is @@ Identity in SQL?

After an INSERT, SELECT INTO, or bulk copy statement is completed, @@IDENTITY contains the last identity value that is generated by the statement. If the statement did not affect any tables with identity columns, @@IDENTITY returns NULL.

What is the use of @@ error in SQL Server?

Using @@ERROR to conditionally exit a procedure. The following example uses IF...ELSE statements to test @@ERROR after an DELETE statement in a stored procedure. The value of the @@ERROR variable determines the return code sent to the calling program, indicating success or failure of the procedure.

What is the difference between and @@ in SQL Server?

There is no difference. The rules for variables state that they start with an '@' character and follow the rules for identifiers.


1 Answers

In SQL Server, symbol @@ is prefixed to global variables.

The server maintains all the global variables. We cannot declare them.

like image 146
Samay Avatar answered Sep 16 '22 12:09

Samay