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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-06-10 : 00:46:27
|
| girish writes "hi this is the question related to the same topic.I am using Insert statement and inserting multiple records through - insert - select combination. I want to get the @@identity of all the records inserted. Is it possible ( I am updating records to same table)thanks in advance" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-06-10 : 07:17:30
|
| Within an INSERT trigger, the inserted pseudo-table contains all of the newly inserted rows. You can join this table to the normal table using the primary key:CREATE TRIGGER ExtraUpdate ON myTable FOR INSERT ASUPDATE MSET M.ThisColumn='Hello!'FROM myTable M INNER JOIN inserted ION M.IDCol=I.IDColTake a look in Books Online for more information on triggers. |
 |
|
|
|
|
|