{"id":1058,"date":"2016-01-15T00:49:59","date_gmt":"2016-01-15T00:49:59","guid":{"rendered":"http:\/\/www.theSQLReport.com\/?p=1058"},"modified":"2016-02-20T13:00:12","modified_gmt":"2016-02-20T13:00:12","slug":"query-to-check-the-last-time-a-teradata-view-was-rebuilt-or-altered","status":"publish","type":"post","link":"https:\/\/www.theSQLReport.com\/?p=1058","title":{"rendered":"Query to Check the Last Time a Teradata View was Rebuilt or Altered"},"content":{"rendered":"<p>Recently I was asked to update a couple of views on a Teradata database.\u00a0 This script was an easy way to verify that the Teradata views\u2019 timestamp for the DDL was updated.<\/p>\n<pre>select\r\nDatabaseName,\r\nTableName, -- This will be the view name\r\nVersion,\u00a0 -- The times this view has been rebuilt\r\nTableKind, -- Should be V for view\r\nCreateTimeStamp,\u00a0 -- When the view first created\r\nLastAlterTimeStamp\u00a0 -- Last time view was rebuilt\r\nfrom Dbc.Tables\r\nwhere\r\nDataBaseName = 'retail' -- isolates for my database only\r\nand\r\nTableKind = 'V'\u00a0 -- forces only views to be displayed\r\nand\r\ntablename in (\u00a0\u00a0\u00a0\u00a0 -- list the views that I am updating\r\n'vAREA' , \u00a0\r\n'vCLIENT' , \r\n'vEMPLOYEE', \r\n'vITEM', \r\n'vPRODUCT' \r\n)\r\norder by 2<\/pre>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2016\/01\/Teradata_Check_Query_DDL.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1062 size-large\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2016\/01\/Teradata_Check_Query_DDL-1024x501.jpg\" alt=\"Teradata Check Query DDL\" width=\"642\" height=\"314\" srcset=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2016\/01\/Teradata_Check_Query_DDL-1024x501.jpg 1024w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2016\/01\/Teradata_Check_Query_DDL-300x146.jpg 300w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2016\/01\/Teradata_Check_Query_DDL-210x102.jpg 210w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2016\/01\/Teradata_Check_Query_DDL.jpg 1199w\" sizes=\"(max-width: 642px) 100vw, 642px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I was asked to update a couple of views on a Teradata database.\u00a0 This script was an easy way to verify that the Teradata views\u2019 timestamp for the DDL &hellip; <a class=\"readmore\" href=\"https:\/\/www.theSQLReport.com\/?p=1058\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":1062,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54],"tags":[58,55],"class_list":["post-1058","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-teradata","tag-query","tag-sql-assistant"],"_links":{"self":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1058"}],"collection":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1058"}],"version-history":[{"count":5,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1058\/revisions"}],"predecessor-version":[{"id":1072,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1058\/revisions\/1072"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/media\/1062"}],"wp:attachment":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1058"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1058"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}