Skip to main content
Solved

Dynamic DAC Generation

  • 22 July 2024
  • 4 replies
  • 48 views

Hi All,

New in-house data engineer here...

I am working on a customization that deals with categorization and tax compliance. Our company has tax categories that are added and removed regularly, so I have made a dynamic SQL script that can reflect these changes in a view.

Is it possible to re-generate the DAC from this view without a republishing the customization with the new code? Is it possible to call the method behind the ‘Generate members from database’ directly?

If so, will the SQL and the C# that define the view and the DAC be run whenever someone requests the G.I., or do I need to add code to the customizations that define the updates and imports to regenerate the SQL View and DAC right away?

 

Thanks,

Aaron

4 replies

Userlevel 7
Badge +9

You can have a stored procedure in SQL that generates the view in question. If the fields and data types of the dynamic view doesn’t change and just the logic (joining, tables, conditions, ...) changes, then you can call your SP from the code (although it is not recommended) to regenerate the view on the fly without the need for re-publishing the code.

Thanks-- I should have specified: this is a pivot dealing with multiple columns of different data types, so the fields will change with any addition or deletion of categories. From what you are saying, we may just need to republish with every legal change?

Userlevel 7
Badge +9

No worries. What you want is to change the DAC declaration meaning some pieces of code should be changed inside the code. In other word self-alteration of a C# code that I don’t think is possible.

That’s good to know-- Even if it is possible, that sounds like more time and resources than I would want to invest in this project. If all new customizations are going to be republished anyway, I don’t know how much marginal benefit the self-updating would be anyway.

Thanks for your help!

Reply