It not a very good idea to print data in Triggers, If you want to know how many updated are you should have a log table in which multiple rows can get inserted and can be reviewed. Saying so if you still want to print the result set you can do the following

but as per my table id's 1 and 2 are updting, i want 1 and 2 values to be print as output.

Please suggest.

triggers in SQL have to assume they are touching more than one row of data; as soon as you assign a value(ie SELECT @id = ID FROM INSERTED) you break that rule; if there are multiple rows in the insert/update, you end up getting the first or last row of the data assigned to the variable...and you don't know which one it was.

so for a spot check during development, yeah maybe i'd see a variable, but it should not exist once your testing is complete.in general, if i see a variable in a trigger, i assume it's written incorrectly. this is one of the first spot checks i run when reviewing a new-to-me database

--triggers have variables defined? select * from sys.triggers where object_definition(object_id) like '%@%'

if this command was inserted, which values, woudl you think appear in your print statments? there are four values to choose from for each column: