{"id":1501,"date":"2021-01-21T12:18:18","date_gmt":"2021-01-21T11:18:18","guid":{"rendered":"https:\/\/sqlkover.com\/?p=1501"},"modified":"2021-01-21T12:19:03","modified_gmt":"2021-01-21T11:19:03","slug":"unable-to-validate-source-query-in-tabular-editor","status":"publish","type":"post","link":"https:\/\/sqlkover.com\/unable-to-validate-source-query-in-tabular-editor\/","title":{"rendered":"Unable to validate source query in Tabular Editor"},"content":{"rendered":"<body>\n<p>When you have a very large fact table in Analysis Services Tabular, you most likely have it partitioned. Suppose you are making some changes to the underlying source of the table and you hit \u201crefresh table metadata\u201d to add some new columns for example.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sqlkover.com\/wp-content\/uploads\/2021\/01\/image.png\"><img decoding=\"async\" width=\"291\" height=\"333\" src=\"https:\/\/sqlkover.com\/wp-content\/uploads\/2021\/01\/image.png\" alt=\"\" class=\"wp-image-1502\" loading=\"lazy\" srcset=\"https:\/\/sqlkover.com\/wp-content\/uploads\/2021\/01\/image.png 291w, https:\/\/sqlkover.com\/wp-content\/uploads\/2021\/01\/image-262x300.png 262w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/a><\/figure>\n\n\n\n<p>What happens behind the scenes is that Tabular Editor will run the query from the first partition against the source. If this is SQL Server, it will surround the query with<a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/statements\/set-fmtonly-transact-sql?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\"> SET FMTONLY ON<\/a> to return only metadata. However, if for whatever reason this query takes a long time, you might encounter a timeout. This throws the error \u201cUnable to validate source query\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sqlkover.com\/wp-content\/uploads\/2021\/01\/image-1.png\"><img decoding=\"async\" width=\"526\" height=\"171\" src=\"https:\/\/sqlkover.com\/wp-content\/uploads\/2021\/01\/image-1.png\" alt=\"\" class=\"wp-image-1503\" loading=\"lazy\" srcset=\"https:\/\/sqlkover.com\/wp-content\/uploads\/2021\/01\/image-1.png 526w, https:\/\/sqlkover.com\/wp-content\/uploads\/2021\/01\/image-1-300x98.png 300w\" sizes=\"auto, (max-width: 526px) 100vw, 526px\" \/><\/a><\/figure>\n\n\n\n<p>Not good. A quick fix is to go to your first partition, edit the query and just add <strong>WHERE 1 = 0 <\/strong>to the end of the query. (Note that I\u2019m using the legacy sources, meaning I\u2019m not using Power Query to extract data. But you should be able to add such a filter there as well.)<\/p>\n\n\n\n<p>Now the table metadata should refresh instantaneously.  I\u2019ve logged a bug for Tabular Editor <a href=\"https:\/\/github.com\/otykier\/TabularEditor\/issues\/736\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>. Just don\u2019t forget to remove your filter from the partition when you\u2019re done \ud83d\ude09<\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>When you have a very large fact table in Analysis Services Tabular, you most likely have it partitioned. Suppose you are making some changes to the underlying source of the table and you hit \u201crefresh table metadata\u201d to add some new columns for example. What happens behind the scenes is that Tabular Editor will run [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[6],"tags":[25,16,145,204],"class_list":["post-1501","post","type-post","status-publish","format-standard","hentry","category-ssas","tag-ssas","tag-syndicated","tag-tabular","tag-tabular-editor"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sqlkover.com\/wp-json\/wp\/v2\/posts\/1501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlkover.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlkover.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlkover.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlkover.com\/wp-json\/wp\/v2\/comments?post=1501"}],"version-history":[{"count":1,"href":"https:\/\/sqlkover.com\/wp-json\/wp\/v2\/posts\/1501\/revisions"}],"predecessor-version":[{"id":1504,"href":"https:\/\/sqlkover.com\/wp-json\/wp\/v2\/posts\/1501\/revisions\/1504"}],"wp:attachment":[{"href":"https:\/\/sqlkover.com\/wp-json\/wp\/v2\/media?parent=1501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlkover.com\/wp-json\/wp\/v2\/categories?post=1501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlkover.com\/wp-json\/wp\/v2\/tags?post=1501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}