1
這是可能的, 它不工作! 試圖執行執行帶同義詞的SQL動態查詢
Declare @SQL as varchar(1000)
Set @SQL = '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'' and t.name in
(''Episode'',''MasterNPI'',''Patient'',''Enterprises'')'
Print @SQL
介意告訴我們什麼,這是實際上是試圖做的,什麼是錯呢? – DForck42