Creating a synonym for a MYSQL-linked server within SQL Server 2008 and above

In a current project it was a requirement to setup synonyms for tables that reside in a MySQL database. This MySQL database was added as “linked server” into SQL Server (via ODBC).

If you do this for other SQL Server objects the syntax is like so

CREATE SYNONYM app.EX_tbl_foobar FOR [LinkedServerName].[dbname].[schema].[tbl_foobar];

The problem was to “transfer” this syntax to the MySQL linked server as MySQL does not support schemas (afaik). Testing finally resulted in the correct syntax. Three dots to the rescue …

CREATE SYNONYM app.MYSQL_tbl_foobar FOR [MYSQL_LinkedServerName]...[tbl_foobar];