Query to Check the Last Time a Teradata View was Rebuilt or Altered

Recently I was asked to update a couple of views on a Teradata database.  This script was an easy way to verify that the Teradata views’ timestamp for the DDL was updated.

TableName, -- This will be the view name
Version,  -- The times this view has been rebuilt
TableKind, -- Should be V for view
CreateTimeStamp,  -- When the view first created
LastAlterTimeStamp  -- Last time view was rebuilt
from Dbc.Tables
DataBaseName = 'retail' -- isolates for my database only
TableKind = 'V'  -- forces only views to be displayed
tablename in (     -- list the views that I am updating
'vAREA' ,  
'vCLIENT' , 
order by 2

Teradata Check Query DDL

Leave a Comment