Search notes:

SQL Server: @@-variables

@@fetch_status

After fetching from a cursor, @@fetch_status is 0 if a record was fetched and non 0 otherwise.

@@identity

See scope_identity(), @@identy and ident_current.

@@options

See @@options

@@rowcount

@@rowcount stores how many recores were affected or read in the most recent sql statement.
update tq84_foo set col_1 = @col_val where id = @foo_id;
if @@rowcount = 0
   print 'No rows were updated'
The Oracle equivalent for @@rowcount seems to be %rowcount.

@@servername

@@servername stores the name of the server. This is the value that is needed for the -S option in sqlcmd.exe to connect to a specific instance.
Compare with serverproperty('ServerName') and @@servicename.

@@servicename

@@servicename returns the name of the registry key below HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server under which an instance is running.
Note: for non default services, the Windows service that runs on behalv of the instance is prefixed with MSSQL$.
For the default instance, both values, @@serivcename and the name of the Windows service are equal: MSSQLSERVER.
Compare with @@servername.

@@spid

@@spid stores the current session id.
@@spid can be joined to the column spid in sys.sysprocesses.

@@trancount

@@trancount counts the nested transactions.

@@version

@@version returns the version of the currently installed SQL Server.

See also

SQL Server: variables

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1737543162, '18.216.167.229', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQL-Server/T-SQL/variables/atat/index(100): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78