Get most recent 100 records from the database I am using SQL Server 2008, we have one database which contains 150 tables. We have introduced systimestamp DATETIME column in every tables. We do update this column with current timestamp whenever Insert/Update operation perform on the table.

How do I write a query to get the most recent (based on systimestamp column) 100 records of the database in a single result set ?
Based on the comments above, what you will need is something like this: 

create table #topdates (ID int not null, TableName nvarchar(128), systimestamp smalldatetime)
exec sp_MSforeachtable @command1 = 'insert into #topdates select top 100 ID, ''?'' as TableName, systimestamp from ? order by systimestamp desc'
select top 100 * from #topdates
order by systimestamp
drop table #topdates


This will collate the top 100 results from each table into a temporary table, and then return the top 100 rows to you.  

EDIT: Based on further information provided in the comments, it was established that the ID field might actually have a different name on every table.  The following SQL will list the top 100 last edited records in the entire database, across all tables, showing the Primary key value, the table name, and the systimestamp: 

create table #keys (TABLE_NAME nvarchar(128), COLUMN_NAME nvarchar(128))
insert into #keys
SELECT cu.TABLE_NAME, cu.COLUMN_NAME
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE cu 
WHERE EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc 
    WHERE tc.CONSTRAINT_TYPE = 'PRIMARY KEY'
        AND tc.CONSTRAINT_NAME = cu.CONSTRAINT_NAME)
create table #topdates (Primary_Key nvarchar(128), TableName nvarchar(128), systimestamp smalldatetime)
declare @table nvarchar(128), @Column nvarchar(128), @sql nvarchar(max)
DECLARE cur CURSOR FOR select * from #keys 
OPEN cur
FETCH NEXT FROM cur INTO @table, @Column 
WHILE @@FETCH_STATUS = 0
BEGIN
    select @sql = 'insert into #topdates select top 100 [' + @Column + '], ''' + @table + ''', systimestamp from [' + @table + '] order by 3 desc '
    exec sp_executesql @sql 
    FETCH NEXT FROM cur INTO @table, @Column
 END
CLOSE cur
DEALLOCATE cur
select top 100 * from #topdates order by systimestamp desc, TableName, Primary_Key
drop table #keys 
drop table #topdates 


You can easily extend this to show the column name of the Primary Key column too.