When filtering a table or a matrix in reporting services you might encounter the following error:
Cannot compare data types of System.Int32 and System.String. Please check the data type returned by the filter expression.
This happens when the column to be filtered is of type numeric (integer in our case) and you try to compare it with a number. The correct way to do it is like in the picture below:
In the value field put another “=” sign otherwise the number will be interpreted as a string and not as a number.
Find all views, stored procedures etc that use a table column
SELECT OBJECT_NAME(sd.id) Dependent_Object,
(SELECT xtype FROM sysobjects so WHERE so.id = sd.id) Object_Type
FROM sysobjects so
INNER JOIN syscolumns sc ON so.id = sc.id
INNER JOIN sysdepends sd ON so.id = sd.depid AND sc.colid = sd.depnumber
WHERE so.id = OBJECT_ID('TABLE_NAME')
AND sc.name = 'TABLE_COLUMN'