use TEST;
gocreate table acc(id int ,issys int);select * from acc;insert AcC(ID,issys) values(3,1022);
insert AcC(ID,issys) values(4,2002);update AcC set issys=32 where id=3 
output --说是这里有错了
inserted.ed,inserted.issys from inserted  
where inserted.id=2

解决方案 »

  1.   

    update AcC set issys=32 
    output --说是这里有错了
    inserted.id,inserted.issys
    where id=3 
      

  2.   

    update AcC set issys=32 
    output --说是这里有错了
    inserted.id,inserted.issys
    where id=3 
      

  3.   

    update AcC set issys=32 
    output --说是这里有错了
    inserted.id,inserted.issys
    where id=3 
      

  4.   


    update AcC set issys=32  
    output --说是这里有错了
    inserted.issys,inserted.id   
    where id=3 ----------------
    是你写错啦
    [ WITH <common_table_expression> [...n] ]
    UPDATE 
        [ TOP ( expression ) [ PERCENT ] ] 
        { <object> | rowset_function_limited 
         [ WITH ( <Table_Hint_Limited> [ ...n ] ) ]
        }
        SET 
            { column_name = { expression | DEFAULT | NULL }
              | { udt_column_name.{ { property_name = expression 
                                    | field_name = expression } 
                                   | method_name ( argument [ ,...n ] ) 
                                  } 
                }
              | column_name { .WRITE ( expression , @Offset , @Length ) }
              | @variable = expression 
              | @variable = column = expression [ ,...n ] 
            } [ ,...n ] 
        [ <OUTPUT Clause> ]
        [ FROM{ <table_source> } [ ,...n ] ] 
        [ WHERE { <search_condition> 
                | { [ CURRENT OF 
                      { { [ GLOBAL ] cursor_name } 
                          | cursor_variable_name 
                      } 
                    ]
                  }
                } 
        ] 
        [ OPTION ( <query_hint> [ ,...n ] ) ]
    [ ; ]<object> ::=

        [ server_name . database_name . schema_name . 
        | database_name .[ schema_name ] . 
        | schema_name .
        ]
            table_or_view_name}
    多看语法
      

  5.   

    create table acc(id int ,issys int);select * from acc;insert AcC(ID,issys) values(3,1022);
    insert AcC(ID,issys) values(4,2002);update AcC set issys=32  
    output --说是这里有错了
    inserted.issys,inserted.id   
    where id=3 drop table acc[ WITH <common_table_expression> [...n] ]
    UPDATE 
        [ TOP ( expression ) [ PERCENT ] ] 
        { <object> | rowset_function_limited 
         [ WITH ( <Table_Hint_Limited> [ ...n ] ) ]
        }
        SET 
            { column_name = { expression | DEFAULT | NULL }
              | { udt_column_name.{ { property_name = expression 
                                    | field_name = expression } 
                                   | method_name ( argument [ ,...n ] ) 
                                  } 
                }
              | column_name { .WRITE ( expression , @Offset , @Length ) }
              | @variable = expression 
              | @variable = column = expression [ ,...n ] 
            } [ ,...n ] 
        [ <OUTPUT Clause> ]
        [ FROM{ <table_source> } [ ,...n ] ] 
        [ WHERE { <search_condition> 
                | { [ CURRENT OF 
                      { { [ GLOBAL ] cursor_name } 
                          | cursor_variable_name 
                      } 
                    ]
                  }
                } 
        ] 
        [ OPTION ( <query_hint> [ ,...n ] ) ]
    [ ; ]<object> ::=

        [ server_name . database_name . schema_name . 
        | database_name .[ schema_name ] . 
        | schema_name .
        ]
            table_or_view_name}
      

  6.   

    create table acc(id int ,issys int);select * from acc;insert AcC(ID,issys) values(3,1022);
    insert AcC(ID,issys) values(4,2002);update AcC set issys=32  
    output --说是这里有错了
    inserted.issys,inserted.id   
    where id=3 drop table acc
    ------
    多看语法
    ][ WITH <common_table_expression> [...n] ]
    UPDATE 
        [ TOP ( expression ) [ PERCENT ] ] 
        { <object> | rowset_function_limited 
         [ WITH ( <Table_Hint_Limited> [ ...n ] ) ]
        }
        SET 
            { column_name = { expression | DEFAULT | NULL }
              | { udt_column_name.{ { property_name = expression 
                                    | field_name = expression } 
                                   | method_name ( argument [ ,...n ] ) 
                                  } 
                }
              | column_name { .WRITE ( expression , @Offset , @Length ) }
              | @variable = expression 
              | @variable = column = expression [ ,...n ] 
            } [ ,...n ] 
        [ <OUTPUT Clause> ]
        [ FROM{ <table_source> } [ ,...n ] ] 
        [ WHERE { <search_condition> 
                | { [ CURRENT OF 
                      { { [ GLOBAL ] cursor_name } 
                          | cursor_variable_name 
                      } 
                    ]
                  }
                } 
        ] 
        [ OPTION ( <query_hint> [ ,...n ] ) ]
    [ ; ]<object> ::=

        [ server_name . database_name . schema_name . 
        | database_name .[ schema_name ] . 
        | schema_name .
        ]
            table_or_view_name}
      

  7.   


    update AcC set issys=32 
    output inserted.*
    where id=3
      

  8.   

    update AcC 
    set issys=32 
    output inserted.ID,inserted.issys 
    where id=3update時 output放在from 和 set 中間insert 時放 insert into 表名(...) 后面delete 時放在 delete 表名 后面
      

  9.   

    update AcC 
    set issys=32 
    output inserted.ID,inserted.issys 
    where id=3