usp_sqlwatch_internal_add_table - CI Collation With CS DB On Same Instance With "Dupe" Table Name
mattcargile opened this issue · 0 comments
Did you check DOCS to make sure there is no workaround?
https://sqlwatch.io/docs/
- Yes
Describe the bug
The step dbo.usp_sqlwatch_internal_add_table
within the Agent Job SQLWATCH-INTERNAL-CONFIG
fails during the below scenario.
- SQLWATCH/model db in CI collation
- CS database exists on same instance
- More than one table name with the same name within the CS database. ( i.e. dbo.TableName and dbo.TABLENAME )
To Reproduce
Steps to reproduce the behavior:
- Create SQL Server Instance with CI collation.
- Create database with CS collation
- Create two tables within this database with a name of
dbo.TableName
anddbo.TABLENAME
Install-DbaSqlWatch -SqlInstance $servername -Database SQLWATCH
- Check History on
SQLWATCH-INTERNAL-CONFIG
Expected behavior
Step dbo.usp_sqlwatch_internal_add_table
shouldn't fail.
Screenshots
N/A
Windows Server (please complete the following information):
- OS Version:
Microsoft Windows Server 2012 R2 Standard
SQL Server (please complete the following information):
- SQL Version:
SQL Server 2017 (RTM-CU20)
- SQL Edition:
Standard
SQL Server Management Studio (SSMS -> about -> copy info):
SQL Server Management Studio 15.0.18386.0
SQL Server Management Objects (SMO) 16.100.46437.65
Microsoft Analysis Services Client Tools 15.0.19618.0
Microsoft Data Access Components (MDAC) 10.0.18362.1
Microsoft MSXML 3.0 5.0 6.0
Microsoft .NET Framework 4.0.30319.42000
Operating System 10.0.18363
SQLWATCH version (from DACPAC or from sysinstances)
4.2.0.28234
from SQLWATCH.dbo.sqlwatch_app_version
. Additionally I used Install-DbaSqlWatch
under dbatools
version 1.1.15
Additional context
The global temp table, ##98308FFC2C634BF98B347EECB98E3490
definition causes the error.
The error happens at this piece of the code. Once the loop reaches the CS database with the "duplicate" table then it fails.