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)

running update SQL query on database

(0) ShareShare
ReportReport
Posted on by

Hi

i have a requirement to append a custom field value in a custom entity to another field within the same entity.

the records are in thousands and i cannot run this using api. given i am only updating custom field of a custom entity

that too within same entity: is it ok to run a weekly over night schedule task to do this in SQL code?

any help is appreciated.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: running update SQL query on database

    Hi Likki ,

    Doing any operation directly  in CRM Database is not a good practice  , so I would prefer to build console and using pagination retrieve more than 5000 records .

    You can check below reference how to retrieve more than 5k records .

    msdn.microsoft.com/.../gg328046.aspx

    docs.microsoft.com/.../page-large-result-sets-with-fetchxml

  • Community Member Profile Picture
    on at
    RE: running update SQL query on database

    Hi Gautam

    the entity has 55000 items and would like to do with SQL stored procedure. any implications if i choose this path?

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: running update SQL query on database

    Hi Likki ,

    Please refer below old thread where I have shared how to write console and schedule the job in windows scheduler.

    community.dynamics.com/.../273478

    Hope this helps.

  • Community Member Profile Picture
    on at
    RE: running update SQL query on database

    hi Adrian could you tell about console application way to achieve this? I am thinking a console application to open SQL connection and execute a stored procedure? is this what you mean by console app?

    any help is much appreciated.

  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at
    RE: running update SQL query on database

    Hi Likki,

    You can do it, but consider SQL Server Integration Services (SSIS), Workflows, and C# Console Applications as alternative options.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans