With Mouse Keys, you can use the numeric keypad on your keyboard—instead of the mouse—to move the pointer. Open Ease of Access Center by clicking the Start button Click Make the mouse easier to use. Under Control the mouse with the keyboard, select the Turn on Mouse Keys check box. After you turn on Mouse Keys, you can use the numeric keypad to move the mouse.
Before you use Mouse Keys to click items on your screen, you must first select which mouse button you want to be the active button: the left button, the right one, or both.
Note: If you choose to make the left mouse button the active button, it will remain the active button until you choose another button. After you select a mouse button, you don't need to select a mouse button again until you want to change buttons. After you choose a button, you can click items on your screen.
You can use the numeric keypad to press and hold the active mouse button and to release it. This is helpful if you want to drag an item.
Notes:
Applies to: SQL Server (all supported versions) Azure SQL Database Azure SQL Managed Instance Defines the attributes of a Transact-SQL server cursor, such as its scrolling behavior and the query used to build the result set on which the cursor operates. DECLARE CURSOR accepts both a syntax based on the ISO standard and a syntax using a set of Transact-SQL extensions. Transact-SQL Syntax ConventionsSyntaxISO Syntax DECLARE cursor_name [ INSENSITIVE ] [ SCROLL ] CURSOR FOR select_statement [ FOR { READ ONLY | UPDATE [ OF column_name [ ,...n ] ] } ] [;] Transact-SQL Extended Syntax DECLARE cursor_name CURSOR [ LOCAL | GLOBAL ] [ FORWARD_ONLY | SCROLL ] [ STATIC | KEYSET | DYNAMIC | FAST_FORWARD ] [ READ_ONLY | SCROLL_LOCKS | OPTIMISTIC ] [ TYPE_WARNING ] FOR select_statement [ FOR UPDATE [ OF column_name [ ,...n ] ] ] [;]Argumentscursor_name INSENSITIVE SCROLL select_statement SQL Server implicitly converts the cursor to another type if clauses in select_statement conflict with the functionality of the requested cursor type. READ ONLY UPDATE [OF column_name [,...n]] cursor_name LOCAL GLOBAL
Note If neither GLOBAL or LOCAL is specified, the default is controlled by the setting of the default to local cursor database option. FORWARD_ONLY STATIC KEYSET
Note If the query references at least one table without a unique index, the keyset cursor is converted to a static cursor. DYNAMIC FAST_FORWARD
Note Both FAST_FORWARD and FORWARD_ONLY can be used in the same DECLARE CURSOR statement. READ_ONLY SCROLL_LOCKS OPTIMISTIC TYPE_WARNING select_statement
Note You can use a query hint within a cursor declaration; however, if you also use the FOR UPDATE OF clause, specify OPTION (<query_hint>) after FOR UPDATE OF. SQL Server implicitly converts the cursor to another type if clauses in select_statement conflict with the functionality of the requested cursor type. For more information, see Implicit Cursor Conversions. FOR UPDATE [OF column_name [,...n]] DECLARE CURSOR defines the attributes of a Transact-SQL server cursor, such as its scrolling behavior and the query used to build the result set on which the cursor operates. The OPEN statement populates the result set, and FETCH returns a row from the result set. The CLOSE statement releases the current result set associated with the cursor. The DEALLOCATE statement releases the resources used by the cursor. The first form of the DECLARE CURSOR statement uses the ISO syntax for declaring cursor behaviors. The second form of DECLARE CURSOR uses Transact-SQL extensions that allow you to define cursors using the same cursor types used in the database API cursor functions of ODBC or ADO. You cannot mix the two forms. If you specify the SCROLL or INSENSITIVE keywords before the CURSOR keyword, you cannot use any keywords between the CURSOR and FOR <select_statement> keywords. If you specify any keywords between the CURSOR and FOR <select_statement> keywords, you cannot specify SCROLL or INSENSITIVE before the CURSOR keyword. If a DECLARE CURSOR using Transact-SQL syntax does not specify READ_ONLY, OPTIMISTIC, or SCROLL_LOCKS, the default is as follows:
Cursor names can be referenced only by other Transact-SQL statements. They cannot be referenced by database API functions. For example, after declaring a cursor, the cursor name cannot be referenced from OLE DB, ODBC or ADO functions or methods. The cursor rows cannot be fetched using the fetch functions or methods of the APIs; the rows can be fetched only by Transact-SQL FETCH statements. After a cursor has been declared, these system stored procedures can be used to determine the characteristics of the cursor.
Variables may be used as part of the select_statement that declares a cursor. Cursor variable values do not change after a cursor is declared. PermissionsPermissions of DECLARE CURSOR default to any user that has SELECT permissions on the views, tables, and columns used in the cursor. Limitations and RestrictionsYou cannot use cursors or triggers on a table with a clustered columnstore index. This restriction does not apply to nonclustered columnstore indexes; you can use cursors and triggers on a table with a nonclustered columnstore index. ExamplesA. Using simple cursor and syntaxThe result set generated at the opening of this cursor includes all rows and all columns in the table. This cursor can be updated, and all updates and deletes are represented in fetches made against this cursor. FETCH NEXT is the only fetch available because the SCROLL option has not been specified. DECLARE vend_cursor CURSOR FOR SELECT * FROM Purchasing.Vendor OPEN vend_cursor FETCH NEXT FROM vend_cursor;B. Using nested cursors to produce report outputThe following example shows how cursors can be nested to produce complex reports. The inner cursor is declared for each vendor. SET NOCOUNT ON; DECLARE @vendor_id INT, @vendor_name NVARCHAR(50), @message VARCHAR(80), @product NVARCHAR(50); PRINT '-------- Vendor Products Report --------'; DECLARE vendor_cursor CURSOR FOR SELECT VendorID, Name FROM Purchasing.Vendor WHERE PreferredVendorStatus = 1 ORDER BY VendorID; OPEN vendor_cursor FETCH NEXT FROM vendor_cursor INTO @vendor_id, @vendor_name WHILE @@FETCH_STATUS = 0 BEGIN PRINT ' ' SELECT @message = '----- Products From Vendor: ' + @vendor_name PRINT @message -- Declare an inner cursor based -- on vendor_id from the outer cursor. DECLARE product_cursor CURSOR FOR SELECT v.Name FROM Purchasing.ProductVendor pv, Production.Product v WHERE pv.ProductID = v.ProductID AND pv.VendorID = @vendor_id -- Variable value from the outer cursor OPEN product_cursor FETCH NEXT FROM product_cursor INTO @product IF @@FETCH_STATUS <> 0 PRINT ' <<None>>' WHILE @@FETCH_STATUS = 0 BEGIN SELECT @message = ' ' + @product PRINT @message FETCH NEXT FROM product_cursor INTO @product END CLOSE product_cursor DEALLOCATE product_cursor -- Get the next vendor. FETCH NEXT FROM vendor_cursor INTO @vendor_id, @vendor_name END CLOSE vendor_cursor; DEALLOCATE vendor_cursor;See Also@@FETCH_STATUS (Transact-SQL) |