Создание SYNONYM

Tsql теория > Создание SYNONYM
23.12.2018 10:27:24


Наиболее часто встречающиеся слова в статье:

[object_id] [synonyms] [''Type_set''] [SCHEMA_ID] [schema_id] [SCHEMAS] [''dbo''] [SYNONYM] [Type_set] [Type_set_Z]


Статья:

IF NOT EXISTS (SELECT object_id FROM sys.synonyms WHERE NAME = ''Type_set'' and  SCHEMA_ID = (SELECT schema_id FROM SYS.SCHEMAS WHERE NAME = ''dbo''))
BEGIN
CREATE SYNONYM [dbo].[Type_set] FOR [MZS].[dbo].[Type_set_Z]
END