Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tintin31
Starting Member
14 Posts |
Posted - 2001-03-01 : 15:54:51
|
Can any one tell me why this is not working. Can I only update a cursor that is based on a non-temporary table:quote: DECLARE @iTest_Id intDECLARE @sFname varchar(10)CREATE TABLE #test ( test_id int not null , fname varchar(10) not null )INSERT INTO #test values ( 1, 'Bob' )INSERT INTO #test values ( 2, 'Sue' )INSERT INTO #test values ( 3, 'Martha' )DECLARE curTest CURSORLOCAL DYNAMICFOR SELECT test_id, fname FROM #testORDER BY test_idFOR UPDATE OF fnameOPEN curTestFETCH FIRST FROM curTestINTO @iTest_Id, @sFnameWHILE @@Fetch_Status = 0BEGIN UPDATE #test SET fname = 'DELETE' WHERE CURRENT OF curTest FETCH NEXT FROM curTest INTO @iTest_Id , @sFnameENDCLOSE curTestDEALLOCATE curTest
I am getting the following message:Server: Msg 16929, Level 16, State 4, Line 14The cursor is READ ONLY.Edited by - tintin31 on 03/01/2001 16:02:31 |
|
|
|
|
|