Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    2

    Unanswered: Updating a partitioned view in a cursor

    I have a partitioned view defined by a UNTION ALL of member tables. I can update the member tables through the view without any problem. However, when I declare a cursor on this partitioned view and try to update the view using WHERE CURRENT OF, I get an error saying 'The target object type is not updatable through a cursor'. Does anyone know if it's the case that updating a partitioned view through cursor is not supported in SQL Server 2000?

    Thanks

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    That'll teach you to use cursors...

    Why do you need a cursor in the first place?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Jan 2004
    Posts
    2
    Basically what I wanted to do through cursor is to assign sequential numbers to certain records that are distributed across member tables.

    It goes something like this:

    ...

    UPDATE MyPartitionedView
    SET SeqNo = @seqNo -- a previously declared/initialized variable
    WHERE CURRENT OF myCursor

    SET @seqNo = @seqNo + 1

    FETCH NEXT FROM myCursor

    ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •