tailieunhanh - Microsoft SQL Server 2000 Programming by Example phần 8

và bạn không thể thả các đối tượng phụ thuộc sử dụng nào của báo cáo RỚT. Liên kết này sẽ biến mất khi chức năng bị rớt hoặc khi thay đổi định nghĩa chức năng bạn không sử dụng tùy chọn SCHEMABINDING. Để giữ cho lựa chọn của tôi, bạn phải đảm bảo các điều kiện sau đó được đáp ứng | Microsoft SQL Server 2000 Programming by Example FROM Categories ORDER BY CategoryName ASC -- Open the cursor OPEN MyCategories -- Fetch the first row FETCH NEXT FROM MyCategories -- Close the cursor CLOSE MyCategories -- Deallocate the cursor DEALLOCATE MyCategories Cursor created was not of the requested type. OUTPUT CategoryID CategoryName Description ------------------------------------------------ 1-------------------------------------------------------------------------------Beverages-Soft drinks coffees teas beers and ales The cursor must be defined for a SELECT statement. This is a normal SELECT statement with a few exceptions. You cannot use COMPUTE COMPUTE BY FOR BROWSE or INTO in a SELECT statement that defines a cursor. Caution If the SELECT statement produces a result set that is not updatable the cursor will be READ_ONLY. This can happen because of the use of aggregate functions insufficient permissions or retrieving read-only data. You can restrict the columns to update inside the cursor using the FOR UPDATE clause as shown in Listing . This clause can be used in two ways FOR UPDATE OF Columnl . ColumnN-Use this option to define columns Column1 to ColumnN as updatable through the cursor. FOR UPDATE This is the default option and it declares all the cursor columns as updatable. Listing Using the FOR UPDATE Clause 482 Chapter 12. Row-Oriented Processing Using Cursors EXAMPLE DECLARE MyCategories CURSOR KEYSET FOR SELECT CategoryID CategoryName Description FROM Categories ORDER BY CategoryName ASC FOR UPDATE OF CategoryName Description Note When you declare a cursor SQL Server creates some memory structures to use the cursor but the data is not retrieved until you open the cursor. Opening Cursors To use a cursor you must open it. You can open a cursor using the OPEN statement. If the cursor was declared as STATIC or KEYSET SQL Server must create a worktable in TempDB to store either the full result set in a STATIC cursor or the keyset only in

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.