Select the inserted/updated value to get affected rows in single query with OUTPUT keyword

April 3, 2013

Select the inserted/Updated Value to get affected rows in single query with OUTPUT keyword

for insert query,

Insert Into tblTest(Name) OutPut Inserted.TestID,Inserted.Name values(‘Juhi’)

Output you will get

Capture

The same thing for update ,

Update tblTest set Name=’Juhi Paunikar’ OutPut inserted.TestID,inserted.Name

The output you will get

bg.jpg Capture1 Enjoy “Sql Queries….!!!”