{"id":1337,"date":"2017-04-01T22:26:50","date_gmt":"2017-04-01T22:26:50","guid":{"rendered":"http:\/\/www.theSQLReport.com\/?p=1337"},"modified":"2017-04-01T22:26:50","modified_gmt":"2017-04-01T22:26:50","slug":"teradata-finding-which-user-is-the-createuid","status":"publish","type":"post","link":"https:\/\/www.theSQLReport.com\/?p=1337","title":{"rendered":"Teradata Finding Which User is the CreateUID"},"content":{"rendered":"<p><strong>Problem:<\/strong><\/p>\n<p>Looking at the dbc.roles table, I want to find which user created a role.\u00a0 There is the 4-byte column in the table called CreateUID, which identifies the user that created the role.\u00a0 Wanting the user name, I struggled to find a matching column in the view dbc.users or dbc.databases views to link for the column CreateUID.<\/p>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/01\/RolesWithCreateUID.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1338 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/01\/RolesWithCreateUID.jpg\" alt=\"RolesWithCreateUID\" width=\"779\" height=\"266\" \/><\/a><\/p>\n<p><strong>Resolution:<\/strong><\/p>\n<p>Using the dbc.dbase table, I was able to link the CreateUID to a DatabaseID to find out the user name.<\/p>\n<pre>sel R.ROLENAME, D.DatabaseNameI as \"OWNER\" \u00a0\r\nfrom dbc.roles R inner join dbc.dbase D on R.CreateUID = D.DATABASEID \r\norder by 1<\/pre>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/01\/TeradataFindRoleOwner.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1339 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/01\/TeradataFindRoleOwner.jpg\" alt=\"TeradataFindRoleOwner\" width=\"709\" height=\"372\" srcset=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/01\/TeradataFindRoleOwner.jpg 709w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/01\/TeradataFindRoleOwner-300x157.jpg 300w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/01\/TeradataFindRoleOwner-210x110.jpg 210w\" sizes=\"(max-width: 709px) 100vw, 709px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem: Looking at the dbc.roles table, I want to find which user created a role.\u00a0 There is the 4-byte column in the table called CreateUID, which identifies the user that &hellip; <a class=\"readmore\" href=\"https:\/\/www.theSQLReport.com\/?p=1337\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":1338,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54],"tags":[92],"class_list":["post-1337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-teradata","tag-createuid"],"_links":{"self":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1337"}],"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=1337"}],"version-history":[{"count":1,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1337\/revisions"}],"predecessor-version":[{"id":1341,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1337\/revisions\/1341"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/media\/1338"}],"wp:attachment":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}