Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    7

    Unanswered: "Multiple-Step operation cannot be generated Check each status value" Error

    Hi All,

    I have a field 'Rowguid' of type uniqueidentifier in a table. This field is the last field in the table. In this case if I update a record through the application I don't get any error. Suppose if there are additional fields after the field Rowguid I get the error "Multiple-Step operation cannot be generated Check each status value"

    For your reference I have used the following statement to add the RowGuid field

    Alter table <tablename>
    Add RowGuid uniqueidentifier ROWGUIDCOL NOT NULL Default (newid())

    Can anyone please help me.


    Thanks

    Sathesh

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Post your update statement, and any trigger code on this table.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Where's Brett when we need him?

    Logically, columns don't have any order within a table. It so happens that the current implementation of Microsoft SQL Server has a physical order, but that's implementation dependant. Relying on a column order (logical or physical) is a bug waiting to happen!

    The problem is that you are not specifying a column list for your INSERT statement, you are relying on an implied order. Once you add columns so that the rowid is no longer the last column, your assumed order bytes you. If you specify the columns via a column list, this won't be a problem.
    Code:
    DROP TABLE BadExample
    GO
    CREATE TABLE BadExample (
       comment		NVARCHAR(25)
       )
    GO
    
    INSERT INTO BadExample
       SELECT 'Simple case'
    
    SELECT * FROM BadExample
    GO
    
    ALTER TABLE BadExample
       ADD RowGuid uniqueidentifier ROWGUIDCOL NOT NULL
          DEFAULT (newid())
    
    INSERT INTO BadExample (comment)
       SELECT 'Not as simple example'
    
    SELECT * FROM BadExample
    GO
    
    ALTER TABLE BadExample
       ADD myDate		DATETIME NOT NULL
          DEFAULT GetDate()
    GO
    
    INSERT INTO BadExample (comment, myDate)
       SELECT 'This works!', '1950-01-02'
    
    SELECT * FROM BadExample
    GO
    
    INSERT INTO BadExample
       SELECT 'This fails', '1960-03-04'
    
    SELECT * FROM BadExample
    -PatP

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by Pat Phelan
    The problem is that you are not specifying a column list for your INSERT statement, you are relying on an implied order.
    How did you come up with that from his post!?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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