Synonyms problems WARNING: The error 'Synonym 'sys_test' refers to an invalid object.' ...

saulcruzsaulcruz Posts: 19 Bronze 1
edited February 2, 2018 4:27PM in DLM Automation
I have a synonym that points to another database, I am following the jenkins CI tutorial

I am using this synonym in a View something like CREATE VIEW vw_Test AS ( select * from sys_test)


$errorActionPreference = "stop"
$options = "-ObjectExistenceChecks, IgnoreUserProperties, IgnoreDatabaseAndServerName"
# Validate the scripts folder
$validatedScriptsFolder = $scriptsFolder | Invoke-DlmDatabaseSchemaValidation -SQLCompareOptions $options # -TemporaryDatabaseServer $buildDb

I don't know what's going on here I've played around with the above options, turning them off and on, and same error:

Invoke-DlmDatabaseSchemaValidation : Schema validation failed: Synonym 'sys_test' refers to an invalid object.
I understand that there are problems when using the three part table name and hardcoding the database name, for the same reason we are using synonyms but they don't seem to work. Any ideas?

UPDATE:
The synonyms seem to work in stored procedures though.
Sign In or Register to comment.