Scheduled Report For Database Names And Sizes
Jul 20, 2005Does anyone has a script which gives all databases names and there
allocated, used sizes in SQLserver2k. I want to schedule this to create a
daily report.
Thanks,
Nasir
Does anyone has a script which gives all databases names and there
allocated, used sizes in SQLserver2k. I want to schedule this to create a
daily report.
Thanks,
Nasir
The below query works perfectly fine, except that it produces many outputs instead of one continuous table that can be easaly converted to xml / csv by copying it from the "Results" window.
What I need is a query that will produce a single result for all the tables in all the databases on the server.
The results:
The query:
DECLARE @begin INT = 1, @end INT, @sql NVARCHAR(MAX)
DECLARE @CREATE_TEMPLATE VARCHAR(MAX);
DECLARE @DBNAME VARCHAR(255);
DECLARE @SQL_SCRIPT VARCHAR(MAX);
SELECT @end = COUNT(name) FROM sys.databases
SET @CREATE_TEMPLATE = '
[Code] ....
Hi,I've run into a curious problem with MS SQL Server 8.0. Using sp_help andSQL Query Analyzer's object browser to view the columns returned by a view,I find that sp_help is reporting stale information.In a recent schema change, for example, someone lengthened a varchar columnfrom 15 to 50 characters. If we use sp_help to find out about a view thatdepends upon this column, it still shows up as VARCHAR(15), whereas theobject browser correctly reports it as VARCHAR(50).Dropping and recreating the view fixes the problem, but we have quite a fewviews, and dropping and re-creating all of them any time a schema change ismade is something we want to avoid. I tried using DBCC CHECKDB in hopes thatit would 'refresh' SQL Server's information, but no luck.(if you're curious as to why I don't just use the object browser instead,read boring technical details below)Has anyone seen this before? Is there some other way (other thanre-creating every view) to tell SQL Server to "refresh" it's information?Thanks!-Scott----------------------Boring Technical Information:The reason this is an issue for us (i.e., I can't just use the objectbrowser instead) is that our object model classes are built using standardmetadata query methods in Java that seem to be returning the same staleinformation that sp_help is returning. These methods are a part of thestandard JDK, so we can't easily fiddle with them. Anyway, as a result, ourobject model (at least with respect to views) may not match our currentschema!
View 5 Replies View RelatedCan anyone offer any help with this?
Error maesage:
Status:
Failure sending mail: The Report Server has encountered a configuration error; more details in the log files
Windows 200 Server: SP4
RS 2000: SP2
SQL Server 2000, on the same server as RS.
We
get this error whenever we try to run a report with the report
attached. However, the email sends fine if the report is not attached.
Reports can also be exported into different formats without problem when viewing the report through report manager.
I have inherited a number of databases which were substantially over sized when they were set up. I'd like to reduce both the log and database files to be smaller than their original sizes, what's the easiest way to do this? If anyone has any experience of doing this please reply.
View 1 Replies View RelatedI've got a 9gig DB which when backed up using the gui comes to 5gigs.When backed using the SQL "backup database" command it comes to 20gigs.Can someone suggest a good reason for the difference?
View 2 Replies View Relatedfind out the list of databases that have ''ldf'' size greater than ''mdf' using stored procedure?
View 7 Replies View RelatedHello,
I'm wondering what would be the best approach to designing a database that will have different products one of them being T-Shirts of different sizes... for example 1 t-shirt design might only have 2 available sizes while another may have 4. I'm kinda stumped on how to approach this cuz there is multiple products like CD's, DVD's, Magazines etc which is pretty straight forward, but the T-shirts have this "variable" to it.
What i'm really wondering is should i have 1 main "Products" Table or should i have a separate table for the t-shirts? Should there be a column for each available size?
Currently my database has a "products table" that has foreign keys to "Product Type", "Artists", "Genre"
The database is basically for a record company
If anyone has designed a database similar to this i'd love any insight or even possibly to see a database diagram
Thanks
I'm trying to capture the sizes of all Databases into a Permanent Table and include the Date.
It works when inserting into a #Temp Table.
When I try inserting into a permanent table it returns NULL.
The following code needs modified to create a permanent table and store the Date:
CREATE TABLE #databases ( DATABASE_NAME VARCHAR(50), DATABASE_SIZE FLOAT, Date VARCHAR(100) )
INSERT #Databases EXEC ('EXEC sp_databases');
SELECT@@SERVERNAME AS SERVER_NAME, DATABASE_NAME,
DATABASE_SIZE AS 'KB',
ROUND(DATABASE_SIZE / 1024, 2) AS 'MB',
ROUND((DATABASE_SIZE / 1024) / 1024, 2) AS 'GB',
CONVERT(date, getdate()) AS Date FROM #databases
DROP TABLE #databases;
Morning forum,
I'm having a problem to which I'm sure the answer is simple...
All I want is a list of databases on my server with their allocated size and the free space within. Something similar to the first table that sp_spaceused gives you but on a server wide scale.
As I say, I'm sure there's a simple solution out there, but alas Google has failed me.
Thanks in advance,
Dan.
Dear Friends:
Could somebody please help me to stop sending scheduled report when no data is present in the report? Actually I have a daily report which is sent to the client and in a week, two or three days, data will not be there and thus it delivers blank report to the client.
So how can I stop sending blank mails to the client?
Thanks in Advance
Emmanuel Mathew
Hi,
I am currently planning on using Reporting Services for delivery of reports, some of which in turn are reliant on an import from FTP via SSIS.
In the event that the FTP fails I would like the delivery of just the dependant reports to be cancelled for just that day.
Any advice on the best way of achieving this?
Cheers,
Martin
We have a number of scheduled reports in our system. But frequently, I
need to kick off one or more of them immediately at random times - to
run off schedule, so to speak. The only way I know to do this is to
actually modify the schedule to set it to run "Once", set the time to
run to be a minute or so into the future, then wait for the report to
run. Afterwards, I go back into the scheduler and re-establish the
original schedule.
Do you know of a way to do this without having to modify and disturb
the original schedule?
Thanks,
Behzad
I am currently exporting scheduled report in excel format via SSRS subscription and the report is getting deposited in 97-2003 (.xls)format. I am using SQL Server 2008 R2 version
Now i need to export the report in .XLSX format. What i need todo to upgrade the exporting excel version (i.e .XLS to .XLSX format ) as .XLXS version is only available from Excel 2007 and later version.
I am having two datasets in the same report, the column names are the same, in both the datasets, Now How can I use the individual fields in same report.
If I use (Fields!xyz.Value, "dsDataSet1") and (Fields!xyz.Value, "dsDataSet2")
It is giving me syntax error.
How can I use both these fieds, I do not want any aggregates
Hi,
I have many lookup tables in my report model. I have tried renaming these fields to more accurately represent the attributes meaning to the end user but I'm having trouble with it.
Here's an example:
I have a table which contains two fields; OfficalGrade and SpecifiedGrade. Both are FK integer values pointing to a Grades lookup table with GradeID as the PK.
In the report builder, the official grade and specified grade fields are both being displayed as GradeID so it's impossible for the user to tell which is which.
In the report model, the Grades Entity has a role for Offical Grade and another for Specified Grade. I've checked both of their properties but I cannot find a setting which will allow me rename the value that is available to the end user.
I'd greatly appreciate any advice on fixing this!
John
Currently, I have a report that takes two parameters: StartDate and EndDate.
I would like to schedule the report to run on a Daily, Weekly, Monthly or Yearly basis, but this doesn't work too well with StartDate and EndDate because the parameter is static. What is the most elegant way to implement this change?
I am new to SQL programming and I am trying to figure out how to get a report to show a mismatch in System Names & DNS Names. Both of the columns are in a table called nodes.
System Name router-1-dc and the DNS would be router-1-dc.domain I am trying to find Nodes that don't match to the "." prior to the domain example for this would be System Name "router-1-datacenter" and DNS Name "router-1-dc.domain" I would want this example to show on the report page.
Here is the SQL Query I built however it does not appear to be working as I need it too.
SELECT N. NodeID, N.Caption, N.SysName, N.DNS, N.IP_Address, N.Device_Type
FROM (
SELECT Nodes.NodeID, Nodes.Caption, Nodes.SysName, Nodes.DNS, Nodes.Device_Type, Nodes.IP_Address
FROM Nodes
code]...
I am building reports against our TFS development db.
One of the reports tracks days spent (Dwell Time) in various status categories (eg: New, Assigned, In Development, Hold, etc) for a given "ticket".
For a fixed list of values from {Work Item].System_State, I can send the results (days in Assigned) to the column named (Assigned) for each status for each event in the [Work Item History], and then sum them for each ticket as:
Ticket ID New Assigned InDev etc
1230001 2 0 0 ...
1230001 0 1 2 ....
SUM 2 1 2 ....
However, I have many different Projects, each of which use their own Status names.
I don't want to duplicate the same basic report, if I can avoid it.
How can I name and generate this data for the unique Status list for each Project?
Simplest analog is: name = First(Fields!Status.Value, "TFSdb")
and allows value for a column name (category) as: =IIF(Fields!Status.Value = First(Fields!Status.Value, "TFSdb"), Fields!Days.Value, 0)
However this fails beause:
1. It only delivers the FIRST status value, and,
2. I cannot SUM an expression which is itself an aggregate (using First).
All,
I want to retrive the column names from an existing report. The report is deployed on the report server and i want to write a code which will list all the column names of the reports along with the properties.
Is there any way i can do this. If so , please let me know. A code sample should help.
Regards..
Girija Shankar
I am wondering if anyone knows how to change the sheet names in Excel when exporting a report from Reporting Services 2005. In other words, I have a report with approximately 5 page breaks built in. When I render the report to Excel, it creates the 5 sheets as I expect, but it names them "Sheet1", "Sheet2", "Sheet3" etc... Is there a way to specify the name of the sheets? I am currently using a different table in my report for each sheet, but I am open to structuring this differently if needed.
View 9 Replies View RelatedHi,
Does anyone has query to give all table sizes on a database?
Appreciate your help.
Thanks
hi
i have been tasked with creating a record of all the reports ( 200+ ) within each folder ( bout 20 ) and all the subscriptions (including parameters) for our SSRS i was wondering what the best way of doing this was (SQL query?)
i have tried creating a site map with visio but im struggling to get the subscriptions details
anyone done this before (or have any ideas) i would be very grateful
thanks
Jake
I am fairly new to SQL server and am having a problem getting the SQL backup or "dump" to do what I need it to do. My desired end result is to have a database backup every night to a backup device on the same server as SQL is running, and keep one weeks worth of databases in the backup device, overwriting the database backup from 7 days before. This device is then transferred sometime later to another server using the NT AT scheduler. The first time I tried to accomplish this I used Enterprise manager to schedule a full backup to be run each night at midnight. The backup device was set to be initialized and retained for 7 days. This procedure worked once, the first night. There after it failed. In looking at books on line it said that I needed to change the transact -SQL command from INIT to NOINIT as the INIT instruction was the cause of the failure. I changed the statement in the Scheduled Task manager to NOINIT. That seemed to do the trick as I checked the backup device each of the next few days and saw that it was indeed performing the backup and retainng the databases. A week later I checked the backup device again and found that it is still adding database dumps to the file, but it is not overwriting the dumps that are 7 days old. I am told that I need the INIT statement in the dumpdevice command in order for the RETAIN DAYS = command to kick in. However, this did not work before. I can not continue adding to the dump device as it will get too large and take up too much disk space on the server. The only way I can get the device to a reasonable size is to do a backup and initialize the device, which gets rid of all of the older databases. This seems like a catch 22. Is there any way I can make this work. I am running SQL 6.5 on the latest service pack (5a). Any help would be greatly appreciated.
View 4 Replies View RelatedI want to schedule a job to run nightly where a remote mysql database is imported into a local sql server db. I ran through the wizard for scheduling a job, previewed my table data, and viewed the scheduled job in the DTS queue. However, the job never runs. I can't figure out why.
Anyone have any idea why? Is there a step-by-step process somewhere for doing this?
Thanks,
C
SQL server 2005 express reporting problem.
error message:
This feature "remote access to report data sources and/or the report server database" is not supported in this edition of reporting service
I got this error message when I try to connect to database hosted in another PC running SQL server 2000.
Is it true that SQlL server Express can only use Local Database Engine to host the database?
just starting with sql server, thru the sql express edition, before i get to far wondering if it is ok to use the same database names, specifically the ASPNetDB.mdf in different web applications, or will this cause problems down the line,
ie will have different web site applications running on IIS and want to use the aspnet_regsl wizard,
also wondering if this has any implicaitons when publishing web application to web servers, are any of the local sql express server settings passed on to the web host provider, read about machine.config and if i understand i should put all the settings in the web.config file via the VS20005 ide.
also will it cause any problem inside the sql express magement console,
Hey all,
Hope I can get some help here.
Have a view that has to reference a table in another database on the same server. This isn't the problem. I am just using Databasename..tablename in the from statement. Get the results required in testing.
The problem is that in production the table name has a space character. i.e. 'accounting info' would be the table name. I have not been able to figure out the proper syntax to capture this properly to reference in the from statement.
I have tried enclosing the name in ' ', " ", [], (), {} and just about every combination I can come up with.
Any help in this would be great, and changing the databse name isn't an option at this time.
Thanx,
Chris
I have two questions:
1. Which system table (data dictionary) I can select to get all table names in one database?
2. What sql command can I use to get a definition about a table?
Thanks
Hi,
Which view I can use to get all database names in a sql server 2005 instance?
Thanks
I am designing a package to export staging tables into a flat file.The names of the tables will be: TableAStaging_YYYYMM and TableBStaging_YYYYMM. As you can see the names of the tables will be changing each month.
The flat files will have similar naming: C:MyPathFlatFileTableAStaging__YYYYMM and C:MyPathFlatFileTableAStaging__YYYYMM.I want to run the package as an sql job in two steps, one for each table.I need to dynamically pass the table names and file names (together with the path) to the IS package.
As part if a recent requirement I have to export Chinese/Singaporean names in a CSV file. The data in the tables is a NVARCHAR(256).
I am using a FlatFile Connection manager where all the present columns from the table are exported as NVARCHARs. My understanding was that the Chinese/Singaporean names would blend seamlessly with NVARCHARs in place. But, they get garbled when pushed to the CSV.
Here is the connection manager setup
There are a lot of suggestions of fixing this by copying/pasting to a notepad file and changing the formatting... But I cant do that since the file is generated using a schedules SSIS package. How can I tweak the process to fix the issue?
Hello,
I have ran into a problem when i'm getting table names in c#.
I have tried the sql command:
select name from sysobjects where type='U' order by name
So it returns the names without a problem. But when I try to access to some tables using their names (to retrieve the columns) I sometimes get the error "Invalid object name" following by the name of the table.
So I realized the if the table was not under dbo user then i would get this error.
for example: "select name from ContactCreditCard"
gives me error because in database management tool it is shown like this: Sales.ContactCreditCard
How can i fix this problem? How to get that prefix of the tables?
Thank you,