Global variables in SQL Server, not many of the common ... I'll see you later.

Source: Internet
Author: User

Global variable format: @@***

These variables are system-maintained and do not require our own definition, and are generally used to view information. The most used @ @error in the stored procedure to determine if there is an error message.

One, @ @version: View version information

Two, @ @identity: View the current identity, followed by the INSERT statement

6 of the last face with the largest ID. After an INSERT statement is executed

Insert into Sdetail (Sname,sscore,sgender) VALUES (' da Vinci ',0)  Select @ @IDENTITY

Execution Result: 7

Three, @ @servername: View server name

Iv.@ @error: Returns the error number of the last executed code, if no error is returned 0; if the North go interrupt is not available

V. @ @rownumber: View the number of affected rows that last executed a line of code

On, baby

Global variables in SQL Server, not many of the common ... I'll see you later.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.