Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Is it safe to create new table in CRM 2013 database and insert into that table from plugin?

(0) ShareShare
ReportReport
Posted on by 56

Hello,

is it safe to create new table in CRM 2013 database from MSSQL Managment tool?

Table will not have any relation with CRM tables and it's sole purpose is to contain composite key of some Primary keys (ID's) of several Entitys.

Is it safe to insert into that table from plugin using plain old ADO.NET SQLConnection class?

Thank you,

Renato

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Is it safe to create new table in CRM 2013 database and insert into that table from plugin?

    Hi Renato,

    We should not modify CRM Database directly even though it doesn't have relation with any of the other tables in CRM. Instead, create an entity in CRM to hold your data. In the plugin, use CRM service methods to create records in the new entity.

    Why not to use ADO.Net to create CRM records?

    When an entity record is created from CRM application or by using SDK, some of the system fields(primary key(guid), createdon, createdby, owningbusinessunitid, ownerid etc) gets populated automatically. You may still be able to populate some of these fields using ADO.Net but it is going to be unnecessary effort as SDK methods are already doing that for us to maintain data consistency. 

  • Abed Haniyah Profile Picture
    Abed Haniyah 4,285 on at
    RE: Is it safe to create new table in CRM 2013 database and insert into that table from plugin?

    I recommend to create an entity and insert your IDs on it by using CRM SDK

  • Verified answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: Is it safe to create new table in CRM 2013 database and insert into that table from plugin?

    Hi Genato,

     you are not going to get a definitive answer as far as the database is concerned. Technically, if you don't touch any of the CRM tables/views/etc, why would Microsoft care? But there is always a chance that you will run into some problems during the upgrade simply because Dynamics setup package might not expect those "third-party" tables in the CRM database.

    As for the ADO etc.. why not? As long as you have all those components installed on the server. Although, there could be some differences between sandbox and non-sandbox plugins (stricter security in the sandbox mode)

  • Suggested answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: Is it safe to create new table in CRM 2013 database and insert into that table from plugin?

    Hi Genato,

    No. Its not supported to write any StoreProc/ Table/ sequence within CRM database.

    With each major update the tables can be deleted and new DB object also get introduced so it in not advised to do that.

    Create a separate database if required.

    From plugin, you can update the database however do consider the connection pool - while there can be multiple instance of same plugin - you will not want that many open connection to your SQL. So just be careful with that.

    Thanks,

    Prateek

  • Genato Profile Picture
    Genato 56 on at
    RE: Is it safe to create new table in CRM 2013 database and insert into that table from plugin?

    Ok, so it's safe to create and insert from MSSQL Managment tool. What about inserting into that table from plugin but using plain old ADO.NET SQLConnection class ?

  • Genato Profile Picture
    Genato 56 on at
    RE: Is it safe to create new table in CRM 2013 database and insert into that table from plugin?

    --

  • Suggested answer
    M.Azwar Alam Profile Picture
    M.Azwar Alam on at
    RE: Is it safe to create new table in CRM 2013 database and insert into that table from plugin?

    Hi,

    You can create table and insert ids in SQL but you can also create an entity and insert your IDs in that entity using CRM SDK in plugin that will be more supported way

    Mark answer as verified if it works for you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans