Firstly whenever you want to declare or set a variable by yourself, I mean user define variable like below codes:
Declare @x datetime
set @x=GetDate()
print x
Secondly in SQL we have two shape to show functions
1. Function Name() like GetDate() --> Give us current time
App_name --> give us current application
all of user define functions
2. @@Function Name (without parentheses)
@@servername
@@version
@@error which is used for TSql instruction and check codes before itself and if it has error it is @@error<> 0 , otherwise @@error=0
@@fetch_status which is checked if there is any record in cursor to read it or not and return integer number it is used with while loop to make decision to read record until there is anything to read.
To wrap up whenever something is defining by user it is with @
when something is reserved by system it has @@
Best Regards
Mahsa
Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator