Hi all,
I can see synonym creation code in tfs source control:
Create Synonym [schema1].[name1] For [$(database1)].[schema2].[name2]
Tried to run this code, it returned no error, but when I tried to run select query
Select * From [schema1].[name1]
it returned error 'Synonym ... referes to an invalid object'.
Then I dropped mentioned synonym and re-created it as
Create Synonym [schema1].[name1] For [database1].[schema2].[name2]
Then select query worked well.
Please, could someone explain me why [$(database1)] syntaxis was used in version control? It doesn't look like typo, because it is used in many places in the code.