简体   繁体   中英

SQL script to determine if CRM 2011 solution is being imported

有没有办法通过SQL确定CRM数据库当前是否因解决方案导入而更新?

[Apologies for copying parts of Ben Williams's answer. I tried to edit his but my edit seemed not to be approved.]

The ImportJob view will show you information about all the solution imports that have happened in the org.

If you started the import using the SDK you can query for the job based on ID, else by whatever method you choose.

There is a Progress column that shows the percentage complete of the import, plus there is XML data in the data column that can be parsed for the status.

This query (from http://sachindgmits.blogspot.co.uk/2012/09/sql-query-to-get-progress-of-importing.html ) shows the most recent job:

Use <<OrgName_MSCRM>>
Go

SELECT TOP 1
    progress                                 [Progress%],
    Solutionname                             [SolutionName],
    DATEADD(hh, 5.5, startedon)              [StartedOnPST],
    DATEADD(hh, 5.5, completedon)            [CompletedOnPST],
    DATEDIFF(second,startedon,completedon)   [TimeTakenInSec],
    DATEDIFF(minute,startedon,completedon)   [TimeTakenInMin],
    createdbyname                            [ImportedBy],
    OrganizationIdName                       [OrgName],
    Data                                     [ImportOutput]
FROM
    importjob IJ (NOLOCK)
ORDER BY
    IJ.startedon DESC

The ImportJob view will show you information about all the solution imports that have happened in the org.

If you started the import using the SDK you can query for the job based on ID, else by whatever method you choose.

There is a Progress column that shows the percentage complete of the import, plus there is XML data in the data column that can be parsed for the status.

不确定查询,但您可以尝试使用sql profiler查看是否有任何查询在您的数据库上实时运行..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM