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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to Regenerate Staging Table

(0) ShareShare
ReportReport
Posted on by 901

Hi,

If we delete physical object of staging table in SQL, can we generate it again in Visual studio ?

I delete it, but in Visual Studio project still there, but failed on Synchronize table. I tried to open Data Entity and right cilck to Regenerate Staging Table option, it didn't do anything.

Thanks,

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    You need to cleanup record in sqldictionary table, first find table id by entity name and then delete all records with this table id from it. 

  • Tony zhong Profile Picture
    901 on at

    Hi where can I find this table ?

  • Sukrut Parab Profile Picture
    71,710 Moderator on at

    You can query  this table using SQL server management studio on dev VM.

  • Tony zhong Profile Picture
    901 on at

    Hi Sukrut,

    Well, 1st of all, I deleted it from SQL management studio. In hope, Visual Studio will recreate it, but it did not.

    So I go to Regenerate Staging, while actually I can see the staging table object in my Project, even I can see it in AOT. But nothing happened,

    Thanks,

  • Tony zhong Profile Picture
    901 on at

    Hi Sukrut,

    Did you mean the sqldictionary table ? ok so can advice how am I going to find it ?

    Thanks,

  • Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    "Regenerate staging table" generates application objects, therefore it's not related to your problem.

    The process that reads application objects and creates corresponding elements in database is database synchronization.

    Yes, Sukrut was answering your question about where you can find SqlDictionary table.

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi Tony

    If you run full sync. from VS you will see the message in the log from DroppedTableValidator with the list of tables. The log message has information about SQL stored procedure which should fix the issue: EXEC SP_REMOVETABLE "table_name". It will do the same steps as Ievgen mentioned in the first post. After you run this stored procedure in SQL you need to perform sync. operation in VS.

    BR, Sergey

  • Blue Wang Profile Picture
    on at

    Hi Tony,

    When you manually delete the staging table in SQL, you return to VS, you can Regenerate Staging Table, and then it will appear in your project. But at this time, database errors will be synchronized, I think this should be the difficulty encountered.

    -

    My solution is to manually create a staging table with the same name through a statement in SQL, and add the required fields of not null, then you can synchronize the database normally, build project.

    -

    Take my table MySelectTable as an example, when you delete MySelectTableStaging, regenerate it in VS, and then create it through SQL statements, and add some not null fields?

    02732.PNG

  • Tony zhong Profile Picture
    901 on at

    Hi Martin,

    Thanks for more information. But the synchronization is failed because probably the "physical" table is deleted. So it is confusing, what should I do first ?

    The Application object as you're saying, is still there and correct the way I see it, but now the table in database is gone. Build is completed but Synchronize is failed. When it is failed, it won't create any object in SQL DB it self, am I right to say that ?

    Btw I found the SQLDictionary table, so as advised, I must delete the field id record (rows) of that table ?

    Thanks,

  • Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    Yes, I understand your situation, I was just explaining why regenerating staging table can't fix your problem.

    You've already got replies explaining what you should do.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans