Download Teach Yourself SQL in 21 Days, Second Edition

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts

Tandem Computers wikipedia , lookup

Concurrency control wikipedia , lookup

Microsoft Access wikipedia , lookup

Oracle Database wikipedia , lookup

Functional Database Model wikipedia , lookup

Database wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Ingres (database) wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Clusterpoint wikipedia , lookup

Null (SQL) wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Database model wikipedia , lookup

Relational model wikipedia , lookup

SQL wikipedia , lookup

PL/SQL wikipedia , lookup

Transcript
@@pack_received
Number of input packets read by SQL Server since it was started.
@@pack_sent
Number of output packets sent by SQL Server since it was
started.
@@packet_errors
Number of errors that have occurred since SQL Server was
started.
@@procid
ID of the currently executing stored procedure.
@@rowcount
Number of rows affected by the last command.
@@servername
Name of the local SQL Server.
@@spid
Process ID number of the current process.
@@sqlstatus
Contains status information.
@@textsize
Maximum length of text or image data returned with SELECT
statement.
@@thresh_hysteresis Change in free space required to activate a threshold.
@@timeticks
Number of microseconds per tick.
@@total_errors
Number of errors that have occurred while reading or writing.
@@total_read
Number of disk reads since SQL Server was started.
@@total_write
Number of disk writes since SQL Server was started.
@@tranchained
Current transaction mode of the Transact-SQL program.
@@trancount
Nesting level of transactions.
@@transtate
Current state of a transaction after a statement executes.
@@version
Date of the current version of SQL Server.
Using Variables
The DECLARE keyword enables you to declare several variables with a single statement
(although this device can sometimes look confusing when you look at your code later).
An example of this type of statement appears here:
1> declare @batter_name char(30), @team int, @average float
2> go
The next section explains how to use variables it to perform useful programming
operations.
Using Variables to Store Data
Variables are available only within the current statement block. To execute a block of
statements using the Transact-SQL language, the go statement is executed. (Oracle uses
the semicolon for the same purpose.) The scope of a variable refers to the usage of the