I have found a script which gives me disk size of all tables:
SELECT TOP 100
-- (row_number() over(order by (a1.reserved + ISNULL(a4.reserved,0)) desc))%2 as l1,
a3.NAME AS [schema]
,a2.NAME AS [table]
,a1.rows AS [rowCount]
[code]...
I was wondering if any has a script which will give me a similar report and a percentage figure of how much each table has grown since past week or month.
I have a requirement to create a Database usage report. The report should have - userid, user name, login time, database to which he has logged in, log out time, host machine id.
How do I go about generating this type of report. What system tables are to be refered?
Does anyone have any reports built that show the usage of the reports based off the ExecutionLog table, or how you would get the "ReportID" to refer back to human readable report name?
I find it hard to believe others have not wanted to see how many reports were ran yesterday, what reports are not being used anymore, and which ones we may need to cache because they are over used throughout the day.
We do have plenty of information about index usage in DMVs and I was wondering if there was any way for us to tell which of the user-created statistics for table were in use.
An error occurred during local report processing. (Microsoft.ReportViewer.WinForms)
------------------------------
The definition of the report 'Main Report' is invalid. (Microsoft.ReportViewer.Common)
------------------------------
An unexpected error occurred in Report Processing. (Microsoft.ReportViewer.Common)
------------------------------
Cannot execute a program. The command being executed was "C:WINDOWSMicrosoft.NETFrameworkv2.0.50727vbc.exe" /noconfig @"C:Documents and SettingsAdministratorLocal SettingsTemp8vikhk2b.cmdline". (System)
Report has been running fine up until now. No changes that I'm aware of. Report runs fine on my laptop connecting to the server.
Update: This is happening with other reports as well. (i.e. Performance Dashboard)
I need to determine how often our SRS reports are being used. Is there any internal metric I can set and then check to find this out? We have a lot of reports and want to find out if some of them can be deleted for low usage. I understand SRS 2005 might have this capability but I have heard there's a way to do this in SRS 2000 as well.
If there is nothing internal to SRS 2000 that will do this, I wonder if anyone else has written some code to do this or has some ingenious method!
I am trying to use a wildcard in a Filter condition within a SSRS - Report Builder report.
Are wildcards of anytime in fact allowed in this tool? I get errors when I try to use SQL-like wildcards such as '%'. I've also been unable to find any mention of "wildcards" in HELP.
I have a client program that writes to sql server database 10 records per second . i want to compute the CPU usage and the memory usage for the whole program or CPU usage,memory usage for the insert statement in the program .
Hello, When I am seeing SQL Server 2005 Management studio Server Dashboard> I am seeing my(USERS) databases and msdb database usage is very small % of in CPU Usage(%), Logical IO Performed (%) Usage pie chart.
90% of Total cpu usage is showing for Adhoc Queries. what excatly this means in Dashboard? if application uses more than it would have shown in Database level or not?
sicerely this dashboard is good, if any one is watching daily, please advice their experiences here.
Edit 2007-8-9: Added code to show database file sizes. Not really closely related to tables sizes, but a lot of the people who need this want to know why their database it so large, so it may help to know which files, especially the logs, are so large, and if the files have empty space in them.
-- Script to analyze table space usage using the -- output from the sp_spaceused stored procedure -- Works with SQL 7.0, 2000, and 2005
set nocount on
print 'Show Size, Space Used, Unused Space, Type, and Name of all database files'
select [FileSizeMB]= convert(numeric(10,2),sum(round(a.size/128.,2))), [UsedSpaceMB]= convert(numeric(10,2),sum(round(fileproperty( a.name,'SpaceUsed')/128.,2))) , [UnusedSpaceMB]= convert(numeric(10,2),sum(round((a.size-fileproperty( a.name,'SpaceUsed'))/128.,2))) , [Type] = case when a.groupid is null then '' when a.groupid = 0 then 'Log' else 'Data' end, [DBFileName]= isnull(a.name,'*** Total for all files ***') from sysfiles a group by groupid, a.name with rollup having a.groupid is null or a.name is not null order by case when a.groupid is null then 99 when a.groupid = 0 then 0 else 1 end, a.groupid, case when a.name is null then 99 else 0 end, a.name
create table #TABLE_SPACE_WORK ( TABLE_NAME sysnamenot null , TABLE_ROWS numeric(18,0)not null , RESERVED varchar(50) not null , DATA varchar(50) not null , INDEX_SIZE varchar(50) not null , UNUSED varchar(50) not null , )
create table #TABLE_SPACE_USED ( Seqintnot null identity(1,1)primary key clustered, TABLE_NAME sysnamenot null , TABLE_ROWS numeric(18,0)not null , RESERVED varchar(50) not null , DATA varchar(50) not null , INDEX_SIZE varchar(50) not null , UNUSED varchar(50) not null , )
create table #TABLE_SPACE ( Seqintnot null identity(1,1)primary key clustered, TABLE_NAME SYSNAME not null , TABLE_ROWS int not null , RESERVED int not null , DATA int not null , INDEX_SIZE int not null , UNUSED int not null , USED_MBnumeric(18,4)not null, USED_GBnumeric(18,4)not null, AVERAGE_BYTES_PER_ROWnumeric(18,5)null, AVERAGE_DATA_BYTES_PER_ROWnumeric(18,5)null, AVERAGE_INDEX_BYTES_PER_ROWnumeric(18,5)null, AVERAGE_UNUSED_BYTES_PER_ROWnumeric(18,5)null, )
declare Cur_Cursor cursor local for select TABLE_NAME= rtrim(TABLE_SCHEMA)+'.'+rtrim(TABLE_NAME) from INFORMATION_SCHEMA.TABLES where TABLE_TYPE= 'BASE TABLE' order by 1
) select TABLE_NAME, TABLE_ROWS, RESERVED, DATA, INDEX_SIZE, UNUSED, USED_MB= round(convert(numeric(25,10),RESERVED)/ convert(numeric(25,10),1024),4), USED_GB= round(convert(numeric(25,10),RESERVED)/ convert(numeric(25,10),1024*1024),4), AVERAGE_BYTES_PER_ROW= case when TABLE_ROWS <> 0 then round( (1024.000000*convert(numeric(25,10),RESERVED))/ convert(numeric(25,10),TABLE_ROWS),5) else null end, AVERAGE_DATA_BYTES_PER_ROW= case when TABLE_ROWS <> 0 then round( (1024.000000*convert(numeric(25,10),DATA))/ convert(numeric(25,10),TABLE_ROWS),5) else null end, AVERAGE_INDEX_BYTES_PER_ROW= case when TABLE_ROWS <> 0 then round( (1024.000000*convert(numeric(25,10),INDEX_SIZE))/ convert(numeric(25,10),TABLE_ROWS),5) else null end, AVERAGE_UNUSED_BYTES_PER_ROW= case when TABLE_ROWS <> 0 then round( (1024.000000*convert(numeric(25,10),UNUSED))/ convert(numeric(25,10),TABLE_ROWS),5) else null end from ( select TABLE_NAME, TABLE_ROWS, RESERVED= convert(int,rtrim(replace(RESERVED,'KB',''))), DATA= convert(int,rtrim(replace(DATA,'KB',''))), INDEX_SIZE= convert(int,rtrim(replace(INDEX_SIZE,'KB',''))), UNUSED= convert(int,rtrim(replace(UNUSED,'KB',''))) from #TABLE_SPACE_USED aa ) a order by TABLE_NAME
print 'Show results in descending order by size in MB'
select * from #TABLE_SPACE order by USED_MB desc go
drop table #TABLE_SPACE_WORK drop table #TABLE_SPACE_USED drop table #TABLE_SPACE
I have a report that calls a stored procedure that creates an extract of data for use by various subreports. Now I have this problem:
If I save the extract data in a global temporary table, then it is automatically deleted before the subreports can use it, this means I have to create a normal table with a unique name that need to be deleted - but where do you do this in the report - there is no point where you can say it is now safe to delete a table?
I do not want to resort to external mechanisms, languages, jobs etc. to do this. I want to delete the table once the report is really finished in the report.
My main report uses a list that contains all the subreports as I need to group all sorts of information by vendor. The main report calls the stored procedure. Please do not tell me that I have to duplicate the main extract for every subreport. That will really eat resources.
Could any one suggest a query which yields the list of tables and columns used in a stored procedures. I know sp_depends has similar functionality, but would like to know the T-SQL code for that..
I have a report that calls a stored procedure that creates an extract of data for use by various subreports. Now I have this problem:
If I save the extract data in a global temporary table, then it is automatically deleted before the subreports can use it, this means I have to create a normal table with a unique name that need to be deleted - but where do you do this in the report - there is no point where you can say it is now safe to delete a table?
I do not want to resort to external mechanisms, languages, jobs etc. to do this. I want to delete the table once the report is really finished in the report.
My main report uses a list that contains all the subreports as I need to group all sorts of information by vendor. The main report calls the stored procedure. Please do not tell me that I have to duplicate the main extract for every subreport. That will really eat resources.
Suppose we have the following table in our database;
CREATE TABLE [dbo].[PERMISSION]( [ID] [int] IDENTITY(1,1) NOT NULL, [USERID] [int] NOT NULL, [STARTTIME] [smalldatetime] NOT NULL, [ENDTIME] [smalldatetime] NOT NULL, [REASON] [nvarchar](250) NULL, [PERMISSIONTYPEID] [int] NOT NULL,
[code]....
This code works pretty well. But I don't want to do this with "select" since there is OUTPUT clause in T-SQL. So the CommandText property will be changed into this;
well, not only this statement gives an error while executing; but also, no such usage defined in the
documentation of OUTPUT Clause. Actually the documentation tell us to use Temporary Tables for that. So I have to change CommandText into this; command.CommandText = @"DECLARE @MyTableVar table(ID int, CREATETIME smalldatetime); insert PERMISSION output INSERTED.ID, INSERTED.CREATETIME into @MyTableVar
code]....
No temporary tables required; thus, no "type spesific" things required. This way is easier to create dynamic queries though. Only,the RETURNING INTO clause.So, I was wondering; why MS-SQL (T-SQL) forces users to "declare a temporary table (type specific)" and "execute select on the temporary table in order to assign values to output parameters" while using "the OUTPUT Clause". Comparing to the Oracle's sample I'm just using "the RETURNING INTO Clause in order to assign values to output parameters" and that's it; very easy and dynamic. To Summarize, Oracle's RETURNING INTO Clause is better than MS-SQL's OUTPUT Clause, but in fact they're doing the same job.
I have an interesting problem to report that I'm hoping someone will be able to assist in solving.
I have a report that contains a table inside of a list. When I view this report on my local machine via Visual Studio, everything appears normal, the columns are all the correct size. However, as soon as I publish this report to the report server and attempt to view it via Report Manager, one of the columns expands horizontally!
From all of the documentation I have read, I understand that Reporting Services does not provide the ability for columns to expand horizontally, only vertically. Can anyone help explain why this is happening or a possible solution to turn this automatic expanding off?
i just clicked on Advanced mode in Column Group, and then in Row Group Side i set Fixed Data=true for first top static. I'm using local report not server report and i'm displaying that local report in Reportviewer. Now also its not working....
I have a report where in I want to show each record on a separate page.
So, to achieve that I took a single cell from table control, expanded it and used all the controls in that single cell. This looks nice so far.
Now, I also have to show a sub grid on each record. So I took a table control and added on the same single cell and tried to add a parent group to the table row.
When I preview, it throws this error.
"The tablix has a detail member with inner members. Detail members can only contain static inner members."
What am I doing wrong? How can I achieve table grouping inside a table cell?
there are two tables involve in replication let say table1 and replicated table is also rep.table1.
we are not deleting records physically in table1 so only a bit in table1 has true when u want to delete a record but the strange thing is that replication agaent report that this is hard delete operation on table1 so download and report hard delete operation and delete the record in replicated table which is very crucial.
plz let me know where am i wrong and how i put it into right way.
there is no triggers on published tables and noother trigger is created on published table.
I have a table that stores inventory across different warehouses. My current Pivot table is able to report on the warehouses themselves, but not the stock IN the warehouse! This is what I have so far. I tried changing this:
sum(WarehouseID) FOR WarehouseID IN ([44],[51],[63],[64],[73],[74],[76],[77],[78]) To this: sum(PhysicalInventoryQty) FOR WarehouseID IN ([44],[51],[63],[64],[73],[74],[76],[77],[78])
Which is the last step, but SQL will not allow it.
Current Result ProductIDPhysicalNYCDropshipFBAFBA CAFBA EUHackensackIn - TransitQuantum CertifiedReturns44 03-KX65-ZSM4NULL000000000NULL 03-Q96D-ZVTDNULL000000000NULL 04-3X1R-013E044735107464006344
i have a dataset which returns me a dynamic set of data ie. number of columns can be different....say 14 columns for some dates...and just 12 for some other...(pivot table is being used in the backend)...how can i present this in the table...also my column names are best suited to be the column headers in the table.....is it possible to create a table at runtime...??
Hi All, Is it possible to multiselect rows in tbale? Whta is want to do is , suppose i have one report showing employee information using table. Is there any way by which user can click on different users in table and corressponding Ids gets stored in some stings & when user clicks on some other textbox he'll be redirected to main applicaition which will use those ids to perform operation on those employees. Currently to do this i have to click on each employee record in table & i dont wnat this. This can be possible if multi selection control is provided in table.
I'm not sure this is possible, but... I was asked to write a SQL Reporting Services Report that reports on a SQL table that is joined to a Sharepoint Table. In trying to look up how to do this, I'm not finding any how-to posts. Is this possible and if so, could you point me in the direction of a step-by-step how -to white paper?
We have a report published to two report servers ( same configuration). this report displays data in two side by side tables. on server 1, the left side table does not get displayed where as both the tables show fine on server 2.
In my report i'm using one table with 16 columns. The header for the table columns comes one stored procedure & rows come from another SP. Also the Visible property of columns is set false if there is value supplied by stored procedure else its true.
As there are 16 columns when i export report single page spans over 2 pages in exported PDF. That is not a issue, the issue is when there are less columns in my report say 8 columns then first 8 columns on first page & next 8 invisible columns on next page ie altername page comes BLANK. Is there any way by which i can change page size for or say size of table dynamically at runtime.
Please let me know within Reporting server database which table stores the actual report name,keywords and author of the report.
I want to search the report based on the report name using my own custom code.It will be helpfull if i get the table name so that i can fire select query.
I need to provide some infomation on how much (trans/request)SQL7 can handle. I checked the white papers and testimonials, but don't see any actual numbers. We have a clustered SQL7 environment sitting on some Compaq 6400 using 4 cpu's. Our database size is only about 3.5 gig and we are using IIS 3. Does anyone know where to get this information?