Dangers of using a trigger to create GUIDs RRS feed

  • Question

  • I’m using some software to insert data into the SQL Server tables of Microsoft CRMv4, however it can’t create the GUIDs needed for the primary keys (e.g. AccountId in the AccountBase table).

    I really don’t want to be messing around with the standard tables in Microsoft CRMv4 but all I can think of doing is creating an insert trigger to create GUID’s for rows that are going to be inserted but don’t have a GUID.

    What are the dangers in this or can someone think of a better way (apart from using different software…)?

    Tuesday, November 3, 2015 3:08 PM


  • Hi Martin,

    Microsoft does not support Inserting/Updating data directly using SQL.

    however I have worked with some customer which has done this mainly because of data load so if you loading 1-2Million records in short span then SQL gives better performance, in this scenario if you doing in SQL you could create your own GUID and then pass same GUID for same record in AccountBase and AccountExtensionbase table.

    Again it is preferred to use support approach so my suggestion is to explore others supported options for this (e.g. SSIS packages using kingsWaysoft, custom code using SDK API etc.) 

    My Blog
    Follow Me on Twitter

    Tuesday, November 3, 2015 4:20 PM