Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

synonym creation syntaxis and tfs source control

$
0
0

 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.


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>