I am trying to merge data from different schemas, using store procedure, I also tried functions but stuck with ERROR 1336: Dynamic SQL is not allowed in stored function or t