Using the Statements Historyyou can view and reuse recently executed T-SQL statements.
Statement History Settings