Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 26, 2010 11:29 AM by anas
Apr 22, 2010 11:00 AM|LINK
I have a dbml file which I have added a couple of tables to. The database also contains synonyms which point to other tables in a different database. I can't seem to drag the synonyms to the design surface though?
Apr 24, 2010 12:20 PM|LINK
It seems that there is no support for them.
I suggest to create a db view that returns all the data from the sysnonym.Then you can add the new db view to te dbml model.
Since the db view is readonly, incase you want to modify synonym data, you can create stored procedures to accomplish such a task.
Apr 24, 2010 05:19 PM|LINK
as long as you have links with grants set up for your user and they're both on the same server you should be able to use a view (as Anas has correctly posted already) and drop that into the dbml.
Apr 26, 2010 08:51 AM|LINK
I didn't think of using a view, i've tended to shy away from them over the years! I don't need to do any updating, so I don't have to write any stored procs.
I wonder is Visual Studio 2010 will allow you add Synonyms?
Apr 26, 2010 11:29 AM|LINK
I didn't think of using a view,
You should.I think it's not even a good idea to use Database Synonyms directly in your code because as you may know, sysnomy names and other stuff may changed during deployment.I would suggest to keep them referenced in your dv Views or SPs and not in your
Hence, using the DB View will be a good idea here, not just because it's a workaround , but using Db Views will also remove the direct dependencies between your code and the Database Synonyms.