0

Is there a way to query a SSDT project to get a list of tables or foreign keys? Similar to what you can do with the actual database?

0

YES! You can query the output to an SSDT project called a dacpac using the DacFx.

The easiest way is to grab this sample project from microsoft (https://github.com/microsoft/DACExtensions/tree/master/DacFxStronglyTypedModel) and build the "DacExtensions" dll then reference that from your own code (c#, powershell etc.)

When you use the DacExtensions you can then you can ask for a list of tables or foreign keys, have a look at this:

https://stackoverflow.com/questions/40747082/finding-data-type-information-for-certain-objects-in-dacfx-api

The question shows how to get the TSQLModel and the answer has how to get a list of tables.

Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.