• I don't think that the error that you got is an error that is generated from SQL Server. I couldn't find an error with similar text and you didn't supply an error number. In any case, you can use a trigger to update table that has no primary key from that trigger update one or few records from the same table. The code bellow does that:

    use tempdb

    go

    --Creating the table

    create table Demo (i int, j int, TimeUpdated datetime)

    go

    --Creating the trigger

    create trigger DocumentUpdateTime

    on Demo

    for update, insert

    as

    --Doing an update without using varibles.

    --More recommended because the update

    --can effect many rows

    update Demo

    set TimeUpdated = getdate()

    from Demo inner join Inserted

    on Demo.i = Inserted.i and Demo.j = Inserted.j

    go

    insert into Demo (i, j)

    select 1,1

    union all

    select 1,1

    union all

    select 1,2

    go

    update Demo set j = 4 where j = 2

    go

    waitfor delay '00:00:01'

    update Demo set j = 3 where j = 1

    go

    --Notice that the value of TimeUpdated

    select * from Demo

    update Demo set j = 1

    --Notice that again it modified the column

    --TimeUpdated. If I was using varibles,

    --it would update some of the records

    select * from Demo

    go

    drop table Demo

    By the way – why don't you have a primary key? You should have one.

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/