SET statement [T-SQL]
608
♦
SET ANSI_PERMISSIONS { ON | OFF }
Adaptive Server Anywhere and Adaptive Server Enterprise regarding
permissions required to carry out an UPDATE or DELETE containing a
column reference is different. Setting ANSI_PERMISSIONS to OFF
provides Transact-SQL-compatible permissions on UPDATE and
DELETE.
♦
SET CLOSE_ON_ENDTRANS { ON | OFF }
Adaptive Server Anywhere and Adaptive Server Enterprise for closing
cursors at the end of a transaction is different. Setting
CLOSE_ON_ENDTRANS to OFF provides Transact-SQL compatible
behavior.
♦
SET QUOTED_IDENTIFIER { ON | OFF }
enclosed in double quotes are interpreted as identifiers (ON) or as literal
strings (OFF). For information about this option, see "Setting options for
Transact-SQL compatibility" on page 969 of the book ASA User's
Guide.
♦
integer The Transact-SQL ROWCOUNT option
SET ROWCOUNT
limits the number of rows fetched for any cursor to the specified integer.
This includes rows fetched by re-positioning the cursor. Any fetches
beyond this maximum return a warning. The option setting is considered
when returning the estimate of the number of rows for a cursor on an
OPEN request.
SET ROWCOUNT also limits the number of rows affected by a
searched UPDATE or DELETE statement to integer. This might be
used, for example, to allow COMMIT statements to be performed at
regular intervals to limit the size of the rollback log and lock table. The
application (or procedure) would need to provide a loop to cause the
update/delete to be re-issued for rows that are not affected by the first
operation. A simple example is given below:
begin
declare @count integer
set rowcount 20
while(1=1) begin
update employee set emp_lname=' new_name '
where emp_lname <> ' old_name '
/* Stop when no rows changed */
select @count = @@rowcount
if @count = 0 break
print string('Updated ',
commit
end
set rowcount 0
end
The default behavior in
The default behavior in
Controls whether strings
@count,' rows; repeating...')
Need help?
Do you have a question about the Adaptive Server Anywhere and is the answer not in the manual?
Questions and answers