EntityFramework-Reverse-POCO-Code-First-Generator icon indicating copy to clipboard operation
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard

Synonym four-part support

Open mmisnerms opened this issue 4 years ago • 5 comments

In our dev and test environments we have synonyms that cross database with three-part names. These are being generated from my template successfully, but if I point to our production environment where the database is on a different server (four-part name), the classes are not generated.

mmisnerms avatar Apr 01 '21 11:04 mmisnerms

Hi @mmisnerms The generator has only been tested with synonyms on the same database server. My thanks go to @TimSirmovics as he was kind enough to add synonym support in the first place. I've labeled this case as a bug to make sure it gets done.

sjh37 avatar Apr 03 '21 10:04 sjh37

We are specifically only looking at synonyms from the current server using this WHERE condition when the #SynonymTargets temp table is built:

ISNULL(PARSENAME(sn.base_object_name, 4), @@SERVERNAME) = @@SERVERNAME; -- Only populate info from current server

It has been a while since I wrote this but I vaguely remember that something didn't work with cross server synonyms so I excluded them.

When I get some time I will set up a new test and see if it can be enabled.

TimSirmovics avatar Apr 14 '21 22:04 TimSirmovics

Has there been any progress on this issue? If there is something that doesn't work with cross server synonyms, please let me know. Really appreciate this product and all the effort put into it.

mmisnerms avatar Apr 19 '22 13:04 mmisnerms

Hi @mmisnerms No update on this from me. Unless its a simple fix, this case will no doubt keep getting bumped as demand for this is quite low. Sorry.

sjh37 avatar Apr 19 '22 14:04 sjh37

I don't think I will have time to look at this in the near future, but you can use my post above as a start if you want to investigate yourself.

TimSirmovics avatar Apr 27 '22 22:04 TimSirmovics