You can run such a query in the original database, and then run the output in your new database.
select 'create synonym syn_' + t.name + ' for [' + DB_NAME() + '].[' + s.name + '].[' + t.name + ']' from sys.tables t inner join sys.schemas s on t.schema_id = s.schema_id where t.type = 'U'
As an example, running this method against the Master database will create:
create synonym syn_spt_fallback_db for [master].[dbo].[spt_fallback_db] create synonym syn_spt_fallback_dev for [master].[dbo].[spt_fallback_dev] create synonym syn_spt_fallback_usg for [master].[dbo].[spt_fallback_usg] create synonym syn_spt_monitor for [master].[dbo].[spt_monitor] create synonym syn_spt_values for [master].[dbo].[spt_values] create synonym syn_MSreplication_options for [master].[dbo].[MSreplication_options]
Joe stefanelli
source share