web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM Dynamics 2015 (on-premise) - Inserting Contact via SQL, error when trying to delete via CRM

(0) ShareShare
ReportReport
Posted on by

Hi all

I wondered if you could assist.

I am trying to automate the addition of contacts into Dynamics CRM via a web form and have written a SP in SQL in order to do this. It works, but when I come to delete the contact via Dynamics CRM, it gives an error that "Integer Value Out Of Range". I have the option to download the log file which provides the following information:

"A validation error occurred.  The value of 'membercount' on record of type 'list' is outside the valid range."

Please could someone shed some light on what I am perhaps doing wrong?

Thanks!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at
    RE: CRM Dynamics 2015 (on-premise) - Inserting Contact via SQL, error when trying to delete via CRM

    Thank you for the suggestions.

    I have answered my own question in the end.

    In case anyone is wondering, as I was not only importing a Contact, but also adding this new Contact straight to a Marketing List, the error was occurring when trying to delete Contact via Dynamics because the "MemberCount" of the relevant Marketing List was out of sync (had managed to creep down to 0) so using my SQL stored procedure I am now updating the "MemberCount" field by 1, as and when a new Contact is added and then added to the Marketing List.

  • Rajkumar Rajaraman Profile Picture
    on at
    RE: CRM Dynamics 2015 (on-premise) - Inserting Contact via SQL, error when trying to delete via CRM

    Best way as using CRM API

  • Community Member Profile Picture
    on at
    RE: CRM Dynamics 2015 (on-premise) - Inserting Contact via SQL, error when trying to delete via CRM

    Appreciate that this isn't supported.

    Just hoping somebody could assist with a possible workaround for this.

  • Royal King Profile Picture
    27,686 on at
    RE: CRM Dynamics 2015 (on-premise) - Inserting Contact via SQL, error when trying to delete via CRM

    Inserting any record to crm via sql is not supported and if you do system may not work as expected. Stop inserting records using sql sp and use CRM API to insert contact to crm.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans