Closed alexander-suprun closed 2 days ago
I have tested this, but I am not able to reproduce it.
Could you post the complete output?
Sure.
CREATE DATABASE Test GO USE Test CREATE TABLE [Test'Table](id INT) GO Use master EXEC dbo.DatabaseIntegrityCheck @Databases = 'Test', @CheckCommands = 'CHECKTABLE'
Output: Date and time: 2022-01-07 09:36:16 Command: USE [Test]; DBCC CHECKTABLE ('[dbo].[Test'Table]') WITH NO_INFOMSGS, ALL_ERRORMSGS, DATA_PURITY Msg 156, Level 15, State 1, Line 7 Incorrect syntax near the keyword 'Table'. Msg 105, Level 15, State 1, Line 7 Unclosed quotation mark after the character string ') WITH NO_INFOMSGS, ALL_ERRORMSGS, DATA_PURITY'. Outcome: Failed Duration: 00:00:00 Date and time: 2022-01-07 09:36:16
This issue has been fixed. Thank you for reporting it.
When you run DatabaseIntegrityCheck with @DatabaseIntegrityCheck = 'CHECKTABLE' and one of the table has a single quote mark (') in the name or schema then the generated DBCC CHECK command will be invalid and fail.
--// Version: 2019-04-28 16:40:00