Forum Discussion

PijushRoy's avatar
PijushRoy
Community Champion
3 years ago
Solved

Need to run SQL Statement which is join by Two Database (Import/Direct Query/Live)

Hi Teams,

Need to run SQL Statement which is join by Two Database. For Direct Query or Import, I need to specify the Server and Database name. Here issue is, in same SQL two database table are joined, so showing error when I am trying. 

 

Are there any process to overcome the issue?

 

Thanks Teams


  • PijushRoy wrote:

    Shahfaisal 
    When you paste SQL Code in SQL Windows box, that time database is compulsary
    Please try.


    Yes, you will be required to if you are putting the sql code. However, you can just specify one of the databases in there. As long as you use three-part naming (specify database name in the code) you should be fine. For example, I just used te following (to show you) on my database server without any issues.

     

     

6 Replies

  • Specifying Database is optional. You can just ignore it and it should work. If you ae still having issues, please post the error. Make sure that your sql code is referencing the database name.

    • PijushRoy's avatar
      PijushRoy
      Community Champion

      Shahfaisal 
      When you paste SQL Code in SQL Windows box, that time database is compulsary
      Please try.

      • Shahfaisal's avatar
        Shahfaisal
        Solution Sage

        PijushRoy wrote:

        Shahfaisal 
        When you paste SQL Code in SQL Windows box, that time database is compulsary
        Please try.


        Yes, you will be required to if you are putting the sql code. However, you can just specify one of the databases in there. As long as you use three-part naming (specify database name in the code) you should be fine. For example, I just used te following (to show you) on my database server without any issues.