• Are their problems with the query?

    What happens if you run them in SSMS (if possible)? Do they succeed?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP