How do I reach out to a DACPAC project references through DAC api?

夙愿已清 提交于 2019-12-11 22:59:53

问题


I'm trying to use GetObject method to obtain an instance of a TSqlObject representing a table from a referenced project:

var id = new ObjectIdentifier(new[] {"ExternalDb"}, new[] {"Schema", "TableName"});

var table = Model.GetObject(ModelSchema.Table, id, DacQueryScopes.All);

Unfortunately that doesn't seem to work.

I've read inside the doc that DacQueryScopes.All will get all objects, EXCEPT those in a non-system db.

So I guess this is why this fails, but then how am I supposed to reach up to elements inside that other project?


回答1:


If you want to query the object in the referenced project then open the dacpac for that referenced project and query that.

The ExternalDb is a pointer to but not an id of the item you want.



来源:https://stackoverflow.com/questions/33179236/how-do-i-reach-out-to-a-dacpac-project-references-through-dac-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!