How do I reach out to a DACPAC project references

2019-09-09 01:47发布

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条回答
Evening l夕情丶
2楼-- · 2019-09-09 02:17

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.

查看更多
登录 后发表回答