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


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….!!!”

Advertisements

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

  1. Christin says:

    I’m not that much of a internet reader to
    be honest but your sites really nice, keep it up! I’ll go ahead and bookmark your site to come back down the road. All the best

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: