Home  >  Article  >  Database  >  Getting Started with SQL Server 7.0 (4)

Getting Started with SQL Server 7.0 (4)

黄舟
黄舟Original
2016-12-24 17:38:301213browse

Manage text and image data
Text and image data type columns can be included in the Select_list of a SELECT statement like other columns. The maximum text size retrieved through a SELECT statement is controlled by the TEXTSIZE setting. The default TEXTSIZE value is 4096 bytes, which can be reset using the SET TEXTSIZE statement. The value of the current TEXTSIZE setting is stored in the global variable @@TEXTSIZE.
Another way to retrieve text and image data is through the TEXTPTR and READTEXT functions. The TEXTPTR function takes a column name as an input parameter and returns a text pointer in binary format.
         This pointer is passed to the READTEXT function to retrieve text and image data, along with the read start pointer called the offset and the number of bytes to read.

Modify data
         TSQL also provides commands for inserting, modifying, and deleting from the database.
Insert
INSERT command is used to insert data into the table. The syntax is as follows:
INSERT [INTO] [(column_list)] VALUES (value_list)
Value_list is the value corresponding to the column in Column_list. These values ​​can be constants, TSQL variables, or SQL Server intrinsic functions. The order of values ​​should correspond to the order of columns in column_list. If column_list is not defined, the order of values ​​should correspond to the order of columns in the table.
   The Values_list of INSERT can also be provided through a SELECT statement or a stored procedure. The syntax is as follows: INSERT [INTO] [(column_list)] SELECT FROM INSERT [INTO] [(column_list)]
EXECUTE
The SELECT statement here can contain multiple connections. If you use a stored procedure, the stored procedure should return results that can be used as a column_list.
The timestamp value should not be provided. At the same time, if the IDENTITY attribute of the column is defined, the value of this column cannot be provided. These values ​​are generated by the system. If columns have default values, their values ​​are not provided and the default values ​​are used.

Modification
The UPDATE statement is used to modify rows. The syntax is as follows:
UPDATE SET = [, = _n]
               _condition>]
        Serach_condition is the condition that the row to be modified should meet. An UPDATE statement without a WHERE clause will modify all rows in the table. Joins can also be used in UPDATE statements.

Delete
     The DELETE statement is used to delete rows from the table. The grammar is as follows: le delete [from] & lt; table_name & gt;
[where & lt; search_condition & gt;] serach_condition is the condition for deleting rows. An unconditional DELETE statement will delete all rows in the table. Connections can also be used in DELETE statements.

The above is the content of Getting Started with SQL Server 7.0 (4). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn