An object containing special characters in the schema name is shown as non-existing on a database side in the Action center tab after the initial commit is finished

Applies to

ApexSQL Source Control

Symptoms

After the linking process and initial commit is done objects with the special characters in their name will be listed only in the Repository column like they have not been committed at all. Those objects will be listed as the Custom script type under the Type column and the wrong schema will be listed under the Schema column.

In addition, one more empty row will be shown in the Action center tab, without any script only with the specified schema under the Schema column. For example, for the table Test\schema.Table_1 the Action center tab after the initial commit will look like this:

Action center tab after the initial commit

Problem

The add-in stores all database object scripts on the file system as a part of the backup, compare, and versioning system, and if the schema name contains any of the special characters, a script with that filename cannot be created on the file system. The add-in will try to recognize what is the schema and what is the object name so the correct file for that object can be created on the file system under correct folders, but it will fail.

In the above-mentioned example, the wrong file will be created in the file system, since the backslash in the schema name will be seen as a part of the path and not as correct schema name. That is why the table schema will be shown in the Action center tab as schema instead of Test\schema, and the related file for that table will be schema.Table_1.sql instead of Test\ schema.Table_1.sql.

On the source control repository side the additional subfolder named Test will be created (in this example under the Tables folder),, since that is recognized as path, with the object named schema.Table_1.sql inside it.

Solution

The only thing in this situation that can be done is to change the schema names in order to exclude the special characters from their names. All objects created under that schema should be modified as well and moved to the new, ’’correct’’ schema.

After that is done, on the source control repository all additionally created folders containing scripts with the wrong name should be deleted.

After the change is done, the Action center tab refresh will show the modified schema and objects under that schema only on the database side, and that is correct behavior. Now the synchronization between the database and the source control can be done without any issue.

Affected versions:

This issue affects all of ApexSQL Source Control versions.