如何查看X ++ select语句的SQL表达式? [英] How to see the SQL expression of an X++ select statement?

查看:117
本文介绍了如何查看X ++ select语句的SQL表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AX中的作业中有以下声明:

I have below statement in a job in AX:

select RecId from pjiTable 
    join pID, Type, PrId from sjTable
    where pjiTable.Prid == sjTable.PrId &&
         (sjTable.Type == PjType::TimeMaterial || sjTable.Type == PjType::FixedPrice);

我必须在SQL Server中使用它.如何将该select语句转换为SQL并在SQL Server Management Studio中使用它?

I have to use it in SQL Server. How can I convert this select statement into SQL and use it in SQL Server Management Studio?

推荐答案

出于调试目的,您可以更改select查询并使用

For debugging purposes you can change your select query and use getSQLStatement method on your table:

select generateOnly forceLiterals RecId from pjiTable 
    join pID, Type, PrId from sjTable 
    where pjiTable.Prid == sjTable.PrId  &&
         (sjTable.Type == PjType::TimeMaterial || sjTable.Type == PjType::FixedPrice);    
info(pjiTable.getSQLStatement());

这将向您显示SQL语句,而无需实际执行该语句.

This will show you SQL statement without actually executing the statement.

这篇关于如何查看X ++ select语句的SQL表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆