I wonder about that can I write native SQL to add or delete operations instead of using Query Expression or FetchXML etc. I know Query Expression is very useful but my real concern is performance and I've thought writing SQL can be faster than the others.

有帮助吗?

解决方案

To put it simply, using direct SQL (especially for create/update actions) is not supported. DO NOT DO IT!

The database model for CRM is complex and updates to data can have effects that extend beyond a simple update to a single table or two.

my real concern is performance

Have you validated this concern? Take a look at this link which documents performance tests on CRM. This is an enterprise-level, scalable platform. If you have proven performance issues then perhaps your code needs optimising or your kit needs beefing up...? :)

其他提示

I totally agree with Greg's answer, this is just as a side note regarding performance. If you really are seeing "performance issues", maybe you should spend your time focusing on seeing if adding an index would be helpful. Although database indexes aren't included within CRM solutions, and will require manual propagation between dev, qa, staging, and prod environments, and are only supported for on-site installations, they can make some queries, 10 or 100 times faster... (of course if they are abused, they can slow everything down as well. Know what you are doing before you use them)

On top of what @Greg & @Daryl have said, when you say performance do you mean its quicker for you to write sql?

Regardless, CRM has some unique ways of doing things.

For example activate/deactivate a record, invoice related actions or the way CRM converts an Opportunity.

It's not that hard to do. You should spend some time in the sdk...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top