December 16, 2012 at 3:03 pm
Hi,
I am trying to create a report which takes the instance_name and Database_name as input parameters and displays the table_name, row_count, column_count, size of the table. I am using the below query to populate the report.
CREATE TABLE #temp (
table_name varchar(50) ,
row_count INT,
reserved_size VARCHAR(50),
data_size VARCHAR(50),
index_size VARCHAR(50),
unused_size VARCHAR(50))
SET NOCOUNT ON
INSERT #temp
EXEC sp_msforeachtable 'sp_spaceused "?"'
SELECT a.table_name,
a.row_count,
COUNT(*) AS col_count,
a.data_size
FROM #temp a
INNER JOIN information_schema.columns b
ON a.table_name collate database_default
= b.table_name collate database_default
GROUP BY a.table_name, a.row_count, a.data_size
ORDER BY CAST(REPLACE(a.data_size, 'KB', '') AS integer) DESC
DROP TABLE #temp
However, the report displays the following warnings and the table_name field is blank. All the other columns are displayed correctly.
warning -
Warning1[rsMissingFieldInDataSet] The dataset ‘Row_count’ contains a definition for the Field ‘Table_name’. This field is missing from the returned result set from the data source.
Warning2[rsErrorReadingDataSetField] The dataset ‘Row_count’ contains a definition for the Field ‘Table_name’. The data extension returned an error during reading the field. There is no data for the field at position 1.
Any help will be appreciated.
December 17, 2012 at 8:15 pm
This issue was fixed.
June 30, 2014 at 6:03 pm
can u please explain how it got fixed ..
July 16, 2015 at 10:03 am
Please advise how did you get this to work... Im having the same problem but no effective solution so far.
Thanks,
Sam
July 16, 2015 at 9:29 pm
Hi,
I found the solution but you won't like the answer :).
I created a brand new report with the exact same query and properties and it worked just fine.
July 20, 2015 at 4:22 am
As per your advise, I created a new report based on the same dataset query and design. Nevertheless, upon attempting to preview the report the warnings would still appear and the values would be missing from the fields relevant to the warnings generated.
What is frustrating is that if I execute the dataset from within the report using query designer then all fields return a value. This means that my underlying dataset sp is in fact intact and the problem is on the report level. I've searched quite a lot for this case but no effective solution is available for this specific scenario. bulding/re-building solution just makes the warnings disappear, but the problem still persists, creating a brand new report based on same design has not resolved it as well.
Any feedback or help is appreciated.
Regards,
Sam
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply