Crashes with An unexpected error....

Is there any workaround for the error below.
It is rendering this tool completely unusable.
I would be grateful for any tips.

I have checked permissions and DBCC

Best regards 
JohnLeo Carton

Error
------------------------------------------------------------------------------------------------------------------------------------------------------------

An unexpected error was encountered while querying the database system tables (for Comment). You may have insufficient permissions, or the database may be in an inconsistent state.  You are recommended to use SQL Compare with dbo permissions.  You can check the database is in a consistent state by running DBCC CHECKDB.

Original error message: Cannot load the Backup Reader dll (see inner exception)!

Query being executed: SQL query: 

SELECT sm.object_id AS id,

definition AS text,

1 AS colid, 

(CASE WHEN OBJECTPROPERTY(so.object_id, N'IsReplProc')<>0 OR so.type = 'P' THEN 1 ELSE 0 END) AS number, 

CAST(CASE WHEN sm.definition IS NULL THEN 1 ELSE 0 END AS bit)  AS Encrypted, -- https://msdn.microsoft.com/en-us/library/ms175081.aspx 

CONVERT(bit, CASE WHEN so.type = 'D' AND so.parent_object_id != 0 THEN 1 ELSE 0 END) AS IsDefault,

ISNULL(sm.uses_quoted_identifier, 0) AS QuotedIdentifier,

NULL AS ctext

FROM sys.sql_modules sm WITH (NOLOCK)

LEFT JOIN sys.objects so WITH (NOLOCK) ON so.object_id = sm.object_id

WHERE (so.type in ('P', 'V', 'TR', 'TA', 'IF', 'FN', 'TF', 'FS', 'FT')

OR (so.type = 'D' AND so.parent_object_id != 0)

OR sm.object_id IN (SELECT object_id FROM sys.triggers WITH (NOLOCK) WHERE parent_class=0))

UNION ALL

SELECT d.object_id AS id,

d.definition AS text,

parent_column_id AS colid,

0 AS number, 

CAST(0 AS BIT) AS Encrypted, -- Not encryptable https://msdn.microsoft.com/en-us/library/ms173758.aspx

CAST(1 AS BIT) AS IsDefault,

CAST(0 AS BIT) AS QuotedIdentifier,

NULL AS ctext

FROM sys.default_constraints d WITH (NOLOCK)

UNION ALL

SELECT

p.object_id AS id,

p.definition AS text, 

CAST(1 as int) AS colid, 

procedure_number AS number, 

CAST(CASE WHEN p.definition IS NULL THEN 1 ELSE 0 END AS bit) AS Encrypted, -- https://msdn.microsoft.com/en-us/library/ms179865.aspx

CAST(0 as bit) AS IsDefault,

m.uses_quoted_identifier AS QuotedIdentifier,

NULL AS ctext

FROM sys.numbered_procedures p WITH (NOLOCK)

LEFT JOIN sys.sql_modules m WITH (NOLOCK) ON p.object_id = m.object_id



ORDER BY id, colid, number


Comments

Sign In or Register to comment.