none
Expression.Error: This native database query is not currently supported.

    Question

  • Hi All,

     I have a Query where it initially drops the tables if it is not null and then perform the operations .

      I am able to execute my query without this drop statement but when I include the state to drop the tables which is the first line of my query then it is encountering the error as "Expression.Error: This native database query is not currently supported."Below is my Query ,Can any one help me how can i solve this this issue

    if object_id('tempdb..#temp') is not null
        drop table #temp
        if object_id('tempdb..#Final') is not null
        drop table #Final
    if object_id('tempdb..#BuildSucceeded') is not null
        drop table #BuildSucceeded
        if object_id('tempdb..#BuildFailed') is not null
        drop table #BuildFailed
         if object_id('tempdb..#DeploySuccess') is not null
        drop table #DeploySuccess
        if object_id('tempdb..#DeployFailed') is not null
        drop table #DeployFailed
         if object_id('tempdb..#ValidationPass') is not null
        drop table #ValidationPass
        if object_id('tempdb..#ValidationFail') is not null
        drop table #ValidationFail
    if object_id('tempdb..#ValidationNotRun') is not null
        drop table #ValidationNotRun


    Thanks,

    Sid


    • Edited by siddiqali Friday, June 06, 2014 6:01 AM
    Friday, June 06, 2014 6:01 AM

Answers

  • Power Query is not really intended as a mechanism for running completely arbitrary SQL statements. Its purpose is to load data, and this query doesn't load data. By the time you get this error, we've already run the query and determined that it doesn't produce any results. If your goal is just the side effects, then Power Query isn't the best tool for the job.

    You can make the error go away by including one final statement which does return data like "select 1 as DONE".

    Friday, June 06, 2014 11:57 AM
    Moderator