Collect Server Information

Jul 27, 2001

I am trying to develop a sql script that will select information from statistical tables on several servers and build a report based on the information collected from each. What SQL statements are used to connect to another database or does anyone have an example of a script that collectes information from several servers?

View 1 Replies


ADVERTISEMENT

Collect DB Information

Jan 20, 2008

Hi,

We have a few Analysis Server databases. I need to go to each server/database and in a Word document write the information for each server/database. For example I have a database called Analysis Services Project 1 with Data Source dsIIBSW. I need to write it in a document. Is there a fast way of doing that?
Thanks

Whisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.

View 2 Replies View Related

Does Sql Server Collect Stats On Full Table Scans?

Jul 20, 2005

Hi all. Anyone know if sql server collects stats on how many fulltable scans a table gets and if so how do I get at those stats? Tryingto track down poorly indexed tables / processes and I am guessing thatsql server does have this data secreted away somewhere much like mydb2 and informix databases do.

View 1 Replies View Related

MS SQL Server 2005: Collect Procedure For Dts Pipeline Generate Error

Nov 21, 2006

Dear experts,

My MS SQL Server 2005 is generating the following error. may i know what's wrong with it?

"
The Collect Procedure for the "DTSPipeline" service in DLL "XXX:Program FilesMicrosoft SQL Server (x86)90DTSBinnDTSPipelinePerf.dll" generated an exception or returned an invalid status. Performance data returned by counter DLL will be not be returned in Perf Data Block. The exception or status code returned is the first DWORD in the attached data.
"

Thanks in advance for any assistance rendered.
pat

View 6 Replies View Related

Collect All ID Of Subordinate Groups

Dec 5, 2014

There is a table with the id and categories Parentid. The challenge is this: you need to collect in each category one drain all the ID that concern it. For Example:

declare @t table (
[id] [bigint],
[Parentid] [bigint],
[Name] [nvarchar](50)
)
insert into @t

[code]....

View 1 Replies View Related

Merge Tables And Collect Origin Info

Apr 29, 2015

If you have 2 tables with the same columns and you would like to see all distinct records in a result of a select and also the information in the records which table the record comes from (for instance: from table A or from table B or bot tables contain it) what should you do?

View 5 Replies View Related

Transact SQL :: Script To Collect TPS In Instance Level?

Oct 22, 2015

I have a requirements to collect Transactions per second from a sql server instances level. Any script to collect TPS in the instance level ?

View 5 Replies View Related

Collect Diverse Data Whilst Database Being Created

Jun 1, 2012

I have just started in a brand new role where I need to collect a large amount of diverse data. Part of this data is whether the steps in a guideline has been followed ( a simple check box or yes/no) (but there are maybe 100 guidelines)

My IT department have suggested we use SQL to create the database, but this will obviously take time. In the meantime my boss is keen that I get on with the data collection before the database is ready. I do not want to repeat steps when I create the SQL database so is there any format you would recommend I collect my data in now that can be easily applied to the SQL database - ie if I used Excel, would that be best, and should I then try to keep potential SQL table data separate?

View 3 Replies View Related

Looking To Collect Distinct Date Part Out Of Datetime Field

Mar 11, 2006

from this, circdate being a datetime field:SQLQuery = "select distinct circdate from circdata order by circdate"I need the distinct date portion excluding the time part.this has come about when I discoveredI am inserting and updating some datetime values with the same value,but for some reason, the values are always off by a few seconds. I seta variable called SetNow assigned to NOW and then set the datetimefields to this SetNow variable. Then when I collect the distinct datetime I am assuming they will have the same values recorded incircdate, but no, they are off by several seconds. Makes no sense to meat all. I tried renaming the variable several times but it makes nodifference at all.any help appreciated, thanks.

View 5 Replies View Related

Integration Services :: Collect Data From Multiple ODBC Source

Jun 11, 2015

I am able to collect data from Progress DB, using ODBC Connectivity. The problem I am facing is, i have to iterate thru multiple servers. How do i configure ODBC source dynamically. It creates problem. Using expression, i tried to set the connectionstring dynamically, but it fails.

View 2 Replies View Related

Collect Missing Index Data Into Central Repository From Sys.dm_db_missing_index_group_stats, Groups, Details

Nov 2, 2007



Greetings:
I am trying to gather into a central location the missing index data from the sys DMV's for dynamic index creation in the next step. In trying to use a cursor, I get the following errors:

Msg 154, Level 15, State 3, Line 20

variable assignment is not allowed in a cursor declaration.

Msg 102, Level 15, State 1, Line 94

Incorrect syntax near 'Get_Data'.

Msg 16916, Level 16, State 1, Line 2

A cursor with the name 'Get_Server' does not exist.

Msg 16916, Level 16, State 1, Line 3

A cursor with the name 'Get_Server' does not exist.


Here is the SQL:


--CREATE PROCEDURE usp_Get_Missing_Index_Data

--AS

--Declare @Sql2 nvarchar(4000)

Declare @Sql nvarchar(4000)

DECLARE Get_Server Cursor -- gets a server name from a list of servers

for

Select MachineName from rsqlaudit1.DBStatistics.dbo.servers

Open Get_Server

Declare @Server nchar(20)

Fetch Next from Get_Server Into

@Server

While (@@FETCH_STATUS = 0) --and (@@FETCH_STATUS <> -2)

BEGIN



DECLARE Get_Data Cursor

FOR

select @sql= 'select distinct id.*

, gs.avg_total_user_cost

, gs.avg_user_impact

, gs.last_user_seek

,gs.unique_compiles

from '+@Server+'.master.sys.dm_db_missing_index_group_stats gs

,'+@Server+'.master.sys.dm_db_missing_index_groups g

,'+@Server+'.master.sys.dm_db_missing_index_details id

where gs.group_handle = g.index_group_handle

and id.index_handle = g.index_handle

order by gs.avg_user_impact desc'

exec (@Sql)



Open Get_Data

DECLARE @Handle int,

@database smallint,

@object int,

@equality nvarchar(4000),

@inequality nvarchar(4000),

@Included nvarchar(4000),

@statement nvarchar(4000),

@avg_user_cost float,

@avg_user_impact float,

@last_seek datetime,

@compiles bigint

Fetch NEXT FROM Get_Data INTO

@Handle,

@database,

@object,

@equality,

@inequality,

@Included,

@statement,

@avg_user_cost,

@avg_user_impact,

@last_seek,

@compiles

While (@@FETCH_STATUS = 0) --and (@@FETCH_STATUS <> -2)

BEGIN

insert into rsqlaudit1.DBStatistics.dbo.Missing_Index_data

values (@Server,

@Handle,

@database,

@object,

@equality,

@inequality,

@Included,

@statement,

@avg_user_cost,

@avg_user_impact,

@last_seek,

@compiles)

FETCH NEXT FROM Get_Data into

@Server,

@Handle,

@database,

@object,

@equality,

@inequality,

@Included,

@statement,

@avg_user_cost,

@avg_user_impact,

@last_seek,

@compiles

Fetch Next from Get_Server Into

@Server

END

CLOSE Get_Data

DEALLOCATE Get_Data

GO

CLOSE Get_Server

DEALLOCATE Get_Server

GO

Any suggestions are appreciated.

Thanks,
Derek

View 3 Replies View Related

SecurityException Class SQLServerDatabaseMetaData's Signer Information Does Not Match Signer Information Of Other

May 23, 2007

Hello,

I have some troubles with IBM WebSphere Application Server using MS SQL Server 2005 JDBC Driver. I always get the error e.g.
java.lang.SecurityException: class "com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData"'s signer information does not match signer information of other classes in the same package

I found this Feedback but it seems to be closed.

A temporary solution for me was to delete the meta-inf directory of the JAR-File, but that can't be the solution.

Can anyone help me with this problem?

Simon

View 4 Replies View Related

Header Information Is Either Corrupted Or Missing. While Synchronization Between SQL Server 2000 &&amp; SQL Server CE 2.0

Jun 30, 2007

Hi
I am stuck while doing synchronization between SQL Server 2000 and SQL Server CE 2.0.
getting an Error "Header information is either corrupted or missing."

My Specification is follow :
Windows XP with SP2
Visual Studio 2005 Enterprise edition
SQL Server 2000 (SP3a)
SQL Server CE 2.0
Application is Smart Device application (Pocket PC 2003) using C#.
Microsoft ActiveSync 4.5
IIS 5.1

I followed steps as per given in this URL :
http://msdn2.microsoft.com/en-us/library/ms839425.aspx#sql_serverce_replication_net_topic2I performed eeach steps successfully, My code is as per given below.

private void button1_Click(object sender, EventArgs e)
{
getSyncReady();
}

SqlCeReplication loSqlCeReplication;
private void getSyncReady()
{
try
{
String lsDBFile = "Northwind.sdf";
loSqlCeReplication = new SqlCeReplication();
loSqlCeReplication.InternetUrl = "http://192.168.0.5/Northwind/sscesa20.dll";
loSqlCeReplication.Publisher = "C99";
loSqlCeReplication.PublisherSecurityMode = SecurityType.NTAuthentication;
loSqlCeReplication.Publication = "NorthwindProducts";
loSqlCeReplication.PublisherDatabase = "Northwind";
loSqlCeReplication.Subscriber = Dns.GetHostName();
loSqlCeReplication.SubscriberConnectionString = "Data Source=" + lsDBFile;
if (!System.IO.File.Exists(lsDBFile))
{
MessageBox.Show("The application requires synchronization", "Replicator",
MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
loSqlCeReplication.AddSubscription(AddOption.CreateDatabase);
}
loSqlCeReplication.Synchronize();
}
catch (Exception foException)
{
throw foException;
}
}



I am not getting whats going wrong.
My Firewall is disable and i have not installed any antivirus softwares (including Norton internet Security....in many forums i got this suggestion but i think its not an issue,even though for solving this issue i performed new installation of Windows XP SP-2 )

View 4 Replies View Related

SQL Server Admin 2014 :: Server Level Trigger To Log Activity And Rollback After Logging Information

Sep 8, 2015

I use following trigger to stop user "smith" if he try to connect through SSMS to My Server:

create TRIGGER [trg_connection_MyServer]
ON ALL SERVER WITH EXECUTE AS 'Smith'
FOR LOGON
AS
BEGIN
IF ORIGINAL_LOGIN()= 'Smith'
begin
if exists (SELECT 1 FROM sys.dm_exec_sessions
WHERE (program_name like 'Microsoft SQL Server%' and original_login_name = 'Smith') )
ROLLBACK;
end

I want to log this information or send emal incase, this user try to connect through SSMS, so that I can catch it. How can I do this, if I use insert command it rollsback everything and I can't do any activity.

View 8 Replies View Related

Table Information In Sql Server

Feb 21, 2008

Hi,
In my Sql Sever i have added one Database "Devtools", by restoring it from .bak file. Now In my asp page I want to Display a Datagrid with data from a table "Devices". I want to Generate the Gridview dynamically. The columns in the table are dynamic they are not constant so I want to generate my Gridview dynamically. So I want to get the columns info of the table and based on that I want to dynamically add the columns to the table.  So how to get the info of the table first. Is there any query where i can get the table info

View 3 Replies View Related

SQL Server Tools Information

May 29, 2005

Hi to all Friends,
Now a days i have a query regarding SQL Server deployment.Is it possible that on our client side we not install enterprise manager due to some managerial problems.Because we are feeling that using enterprise manager our database design is not save and somebody can copy it.Please help me on this issue.
Thanks

View 4 Replies View Related

Storing Server Information

Apr 9, 2001

Hello,
We are just setting up SQL Server 2000 and wanted to keep track of all our server settings(everything needed for worst case scenario). Does anybody have a standard template that we could follow to record all our info?

Thanks!

View 2 Replies View Related

Getting Version Information From SQL Server

Nov 27, 2007

Hello,

I'm trying to get the version information for my SQL servers. Specifically I want to get the major, minor, release and build numbers separately.

Does anyone know what the recommended method for doing this is?

I tried using @@microsoftversion but I can't find any documentation about it.

@@VERSION has the information in it but I'd have to parse the text, not something I want to do and it means the code can easily be broken if the format of the string changes.

xp_msver has what I need but I want to run this as a T-SQL batch so I can't access the results of xp_msver.

Just to add another restriction the code should be compatible with SQL server 2000 and, if possible SQL 7.0 (although not necessary).

Basically I have a script that I want to run on my servers that removes all users except dbo and guest from my databases. At the moment I query master.dbo.sysxlogins table but this doesn't work on 2005 so I thought I could check the version and run a different query for those servers.

Any help appreciated.
Kep.

View 3 Replies View Related

Sql Server Performance Information

May 27, 2008



How do you test and make sure the query is executing fast?I would like to know & learn about the peroformance issues which i need to check in sql server 2005

Please let me know

Thanks

View 2 Replies View Related

Table Information From SQL Server

Mar 14, 2008

Hi

I have a problem I am trying to ascertain the quality of the data in the table of a system we are migrating from one database to another.

We have already taken the step of converting it into SQL server to make sense of it now I wnat to query the data itself

To do this I set up a query that went through sysobjects and syclumns and listed the tables and their columns

What I want to do now is use this information to query the data elements themselves to determine where we should concentrate our data mapping on.

I started out with a cursor doing this
declare @table varchar(50)
declare @col varchar(50)
declare @result int
declare count_cursor cursor scroll
for select tname,cname from infotemp
open count_cursor
fetch from count_cursor
into @table,@col
while @@fetch_status=0
BEGIN
exec ('select count('+@col+') from '+@table)
Fetch next from count_cursor into @table,@col
END
close count_cursor
deallocate count_cursor

But I am having problems getting the counted value into the result value from the exec statement

Anybody got any ideas

Thanks

View 4 Replies View Related

SQL Server Licensing Information

Feb 22, 2008



I want to retrieve SQL server licensing information e.g. License type, Count, License Code etc.
Any help?

RK

View 4 Replies View Related

Licensing Information Of An SQL Server Installation

Sep 13, 2001

How do we findout licening Infromation of an SQL Server Installtion.

Is there any script or stored procedure to find this Information.
What is the difference between Per Server and Per seat Licensing ?

Thanks a lot for your Support.

Regards

Elias

View 1 Replies View Related

Moving Login Information From One Server To Another

Aug 9, 2001

I am in the process of building a new server to replace an existing one which is already on SQL Server 2000. I am looking to move the login information from one server to another without having to type them. Any ideas?

Steve Jimmo

View 2 Replies View Related

INFORMATION SCHEMA And LInked Server

Sep 5, 2007

I know I've done this before and I can't find, and it's kinda of foggy here today...

anyone see anything with this


EXEC sp_addlinkedserver
'PAERSCBVD0045',
N'SQL Server'

Connect as X002548 since logins are on both serves

*/

-- Tables in 14 not in 45

SELECT S14.TABLE_NAME
FROM INFORMATION_SCHEMA.Tables S14
LEFT JOIN INFORMATION_SCHEMA.PAERSCBVD0045.dbo.MEP.Tables S45
ON S14.TABLE_SCHEMA = S45.TABLE_SCHEMA
AND S14.TABLE_NAME = S45.TABLE_NAME
WHERE S45.TABLE_SCHEMA = IS NULL
AND S45.TABLE_NAME = IS NULL

View 5 Replies View Related

Information Schema In SQL Server 2005

Sep 6, 2007

Information Schema is the part of the SQL-92 standard which exposes the metadata of the database. I have written a small article that exposes the same. Let me know your comments on the same. http://aspalliance.com/1380_Information_Schema_and_SQL_Server_2005

Uday Denduluri
Software Engineer
Refer my articles at http://aspalliance.com/author.aspx?uId=62740

View 5 Replies View Related

Get Server Database File Information

Sep 7, 2007

This script gets the file information for every database on a server, and inserts it into temp table #DB_INFO. #DB_INFO is queried multiple ways to give various levels of analysis of file space usage.

This script was tested on SQL Server 7.0, 2000, and 2005.


Edit 2007/9/7: Added FILEGROUP_TYPE and DISK columns.

Edit 2007/9/17: Modified to add various ways to analyze the output and format it to make it easier to understand space usage on the server:
Show Files Details
Total by Database and File
Total by Database and Filegroup
Total by Database and Filegroup Type
Total by Disk, Database, and Filepath
Total by Disk and Database
Total by Database

Edit 2007/9/17: Modified to make the changes suggested by eyechart. I managed to defeat Snitz to get rid of the smiley face () and still have executable code by putting in some extra quotes around the database name.





use master
go
if exists ( select * from tempdb.dbo.sysobjects o
where o.xtype in ('U') and o.id = object_id( N'tempdb..#DB_FILE_INFO' ))
drop table #DB_FILE_INFO
go

if exists ( select * from tempdb.dbo.sysobjects o
where o.xtype in ('U') and o.id = object_id( N'tempdb..#DB_INFO' ))
drop table #DB_INFO
go
set nocount on
go
create table #DB_FILE_INFO (
[ID]intnot null
identity (1, 1) primary key clustered ,
[DATABASE_NAME]sysnamenot null ,
[FILEGROUP_TYPE]nvarchar(4)not null ,
[FILEGROUP_ID]smallintnot null ,
[FILEGROUP]sysnamenot null ,
[FILEID]smallintnot null ,
[FILENAME]sysnamenot null ,
[DISK]nvarchar(1)not null ,
[FILEPATH]nvarchar(260)not null ,
[MAX_FILE_SIZE]intnull ,
[FILE_SIZE]intnot null ,
[FILE_SIZE_USED]intnot null ,
[FILE_SIZE_UNUSED]intnot null ,
[DATA_SIZE]intnot null ,
[DATA_SIZE_USED]intnot null ,
[DATA_SIZE_UNUSED]intnot null ,
[LOG_SIZE]intnot null ,
[LOG_SIZE_USED]intnot null ,
[LOG_SIZE_UNUSED]intnot null ,
)
go

declare @sqlnvarchar(4000)
set @sql =
'use ['+'?'+'] ;
if db_name() <> N''?'' goto Error_Exit

insert into #DB_FILE_INFO
(
[DATABASE_NAME],
[FILEGROUP_TYPE],
[FILEGROUP_ID],
[FILEGROUP],
[FILEID],
[FILENAME],
[DISK],
[FILEPATH],
[MAX_FILE_SIZE],
[FILE_SIZE],
[FILE_SIZE_USED],
[FILE_SIZE_UNUSED],
[DATA_SIZE],
[DATA_SIZE_USED],
[DATA_SIZE_UNUSED],
[LOG_SIZE],
[LOG_SIZE_USED],
[LOG_SIZE_UNUSED]
)
selecttop 100 percent
[DATABASE_NAME] = db_name(),
[FILEGROUP_TYPE]= case when a.groupid = 0 then ''Log'' else ''Data'' end,
[FILEGROUP_ID]= a.groupid,
a.[FILEGROUP],
[FILEID]= a.fileid,
[FILENAME]= a.name,
[DISK]= upper(substring(a.filename,1,1)),
[FILEPATH]= a.filename,
[MAX_FILE_SIZE] =
convert(int,round(
(case a.maxsize when -1 then null else a.maxsize end*1.000)/128.000
,0)),
[FILE_SIZE]= a.[fl_size],
[FILE_SIZE_USED] = a.[fl_used],
[FILE_SIZE_UNUSED] = a.[fl_unused],
[DATA_SIZE]= case when a.groupid <> 0 then a.[fl_size] else 0 end,
[DATA_SIZE_USED]= case when a.groupid <> 0 then a.[fl_used] else 0 end,
[DATA_SIZE_UNUSED] = case when a.groupid <> 0 then a.[fl_unused] else 0 end,
[LOG_SIZE] = case when a.groupid = 0 then a.[fl_size] else 0 end,
[LOG_SIZE_USED] = case when a.groupid = 0 then a.[fl_used] else 0 end,
[LOG_SIZE_UNUSED] = case when a.groupid = 0 then a.[fl_unused] else 0 end
from
(
Select
aa.*,
[FILEGROUP]= isnull(bb.groupname,''''),
-- All sizes are calculated in MB
[fl_size]=
convert(int,round((aa.size*1.000)/128.000,0)),
[fl_used]=
convert(int,round(fileproperty(aa.name,''SpaceUsed'')/128.000,0)),
[fl_unused]=
convert(int,round((aa.size-fileproperty(aa.name,''SpaceUsed''))/128.000,0))
from
dbo.sysfiles aa
left join
dbo.sysfilegroups bb
on ( aa.groupid = bb.groupid )
) a
order by
case when a.groupid = 0 then 0 else 1 end,
a.[FILEGROUP],
a.name

Error_Exit:

'

--print @sql

exec sp_msforeachdb @sql

--select * from #DB_FILE_INFO

declare @DATABASE_NAME_LENvarchar(20)
declare @FILEGROUP_LENvarchar(20)
declare @FILENAME_LENvarchar(20)
declare @FILEPATH_LENvarchar(20)

select
@DATABASE_NAME_LEN= convert(varchar(20),max(len(rtrim(DATABASE_NAME)))),
@FILEGROUP_LEN= convert(varchar(20),max(len(rtrim(FILEGROUP)))),
@FILENAME_LEN= convert(varchar(20),max(len(rtrim(FILENAME)))),
@FILEPATH_LEN= convert(varchar(20),max(len(rtrim(FILEPATH))))
from
#DB_FILE_INFO

if object_id('tempdb..##DB_Size_Info_D115CA380E2B4538B6CBBB51') is not null
begin
drop table ##DB_Size_Info_D115CA380E2B4538B6CBBB51
end

-- Setup code to reduce column sizes to max used
set @sql =
'
select
[DATABASE_NAME]= convert(varchar('+@DATABASE_NAME_LEN+'), a.[DATABASE_NAME] ),
a.[FILEGROUP_TYPE],
[FILEGROUP_ID],
[FILEGROUP]= convert(varchar('+@FILEGROUP_LEN+'), a.[FILEGROUP]),
[FILEID],
[FILENAME]= convert(varchar('+@FILENAME_LEN+'), a.[FILENAME] ),
a.[DISK],
[FILEPATH]= convert(varchar('+@FILEPATH_LEN+'), a.[FILEPATH] ),
a.[MAX_FILE_SIZE],
a.[FILE_SIZE],
a.[FILE_SIZE_USED],
a.[FILE_SIZE_UNUSED],
FILE_USED_PCT=
convert(numeric(5,1),round(
case
when a.[FILE_SIZE] is null or a.[FILE_SIZE] = 0
then NULL
else (100.00000*a.[FILE_SIZE_USED])/(1.00000*a.[FILE_SIZE])
end ,1)) ,
a.[DATA_SIZE],
a.[DATA_SIZE_USED],
a.[DATA_SIZE_UNUSED],
a.[LOG_SIZE],
a.[LOG_SIZE_USED],
a.[LOG_SIZE_UNUSED]
into
##DB_Size_Info_D115CA380E2B4538B6CBBB51
from
#DB_FILE_INFO a
order by
a.[DATABASE_NAME],
case a.[FILEGROUP_ID] when 0 then 0 else 1 end,
a.[FILENAME]
'

--print @sql

exec ( @sql )

selecttop 100 percent
*
into
#DB_INFO
from
##DB_Size_Info_D115CA380E2B4538B6CBBB51 a
order by
a.[DATABASE_NAME],
case a.[FILEGROUP_ID] when 0 then 0 else 1 end,
a.[FILENAME]

drop table ##DB_Size_Info_D115CA380E2B4538B6CBBB51

set nocount off

print 'Show Details'
select * from #DB_INFO

print 'Total by Database and File'
select
[DATABASE_NAME]= isnull([DATABASE_NAME],' All Databases'),
[FILENAME]= isnull([FILENAME],''),
FILE_SIZE= sum(FILE_SIZE),
FILE_SIZE_USED= sum(FILE_SIZE_USED),
FILE_SIZE_UNUSED= sum(FILE_SIZE_UNUSED),
FILE_USED_PCT=
convert(numeric(5,1),round(
case
when sum(a.[FILE_SIZE]) is null or sum(a.[FILE_SIZE]) = 0
then NULL
else (100.00000*sum(a.[FILE_SIZE_USED]))/(1.00000*sum(a.[FILE_SIZE]))
end ,1)) ,
DATA_SIZE= sum(DATA_SIZE),
DATA_SIZE_USED= sum(DATA_SIZE_USED),
DATA_SIZE_UNUSED= sum(DATA_SIZE_UNUSED),
LOG_SIZE= sum(LOG_SIZE),
LOG_SIZE_USED= sum(LOG_SIZE_USED),
LOG_SIZE_UNUSED= sum(LOG_SIZE_UNUSED)
from
#DB_INFO a
group by
[DATABASE_NAME],
[FILENAME]
with rollup
order by
case when [DATABASE_NAME] is null then 1 else 0 end ,
[DATABASE_NAME],
case when [FILENAME] is null then 1 else 0 end ,
[FILENAME]


print 'Total by Database and Filegroup'

select
--[Server]= convert(varchar(15),@@servername),
[DATABASE_NAME]= isnull([DATABASE_NAME],'** Total **'),
[FILEGROUP]=
case when [FILEGROUP] is null then '' when [FILEGROUP] = '' then 'LOG' else [FILEGROUP] end,
FILE_SIZE= sum(FILE_SIZE),
FILE_SIZE_USED= sum(FILE_SIZE_USED),
FILE_SIZE_UNUSED= sum(FILE_SIZE_UNUSED),
FILE_USED_PCT=
convert(numeric(5,1),round(
case
when sum(a.[FILE_SIZE]) is null or sum(a.[FILE_SIZE]) = 0
then NULL
else (100.00000*sum(a.[FILE_SIZE_USED]))/(1.00000*sum(a.[FILE_SIZE]))
end ,1)) ,
--MAX_SIZE= SUM([MAX_FILE_SIZE]),
DATA_SIZE= sum(DATA_SIZE),
DATA_SIZE_USED= sum(DATA_SIZE_USED),
DATA_SIZE_UNUSED= sum(DATA_SIZE_UNUSED),
LOG_SIZE= sum(LOG_SIZE),
LOG_SIZE_USED= sum(LOG_SIZE_USED),
LOG_SIZE_USED= sum(LOG_SIZE_UNUSED)
from
#DB_INFO A
group by
[DATABASE_NAME],
[FILEGROUP]
with rollup
order by
case when [DATABASE_NAME] is null then 1 else 0 end ,
[DATABASE_NAME],
case when [FILEGROUP] is null then 10 when [FILEGROUP] = '' then 0 else 1 end ,
[FILEGROUP]


print 'Total by Database and Filegroup Type'

select
--[Server]= convert(varchar(15),@@servername),
[DATABASE_NAME]= isnull([DATABASE_NAME],'** Total **'),
[FILEGROUP_TYPE]= isnull([FILEGROUP_TYPE],''),
FILE_SIZE= sum(FILE_SIZE),
FILE_SIZE_USED= sum(FILE_SIZE_USED),
FILE_SIZE_UNUSED= sum(FILE_SIZE_UNUSED),
FILE_USED_PCT=
convert(numeric(5,1),round(
case
when sum(a.[FILE_SIZE]) is null or sum(a.[FILE_SIZE]) = 0
then NULL
else (100.00000*sum(a.[FILE_SIZE_USED]))/(1.00000*sum(a.[FILE_SIZE]))
end ,1)) ,
DATA_SIZE= sum(DATA_SIZE),
DATA_SIZE_USED= sum(DATA_SIZE_USED),
DATA_SIZE_UNUSED= sum(DATA_SIZE_UNUSED),
LOG_SIZE= sum(LOG_SIZE),
LOG_SIZE_USED= sum(LOG_SIZE_USED),
LOG_SIZE_USED= sum(LOG_SIZE_UNUSED)
from
#DB_INFO A
group by
[DATABASE_NAME],
[FILEGROUP_TYPE]
with rollup
order by
case when [DATABASE_NAME] is null then 1 else 0 end ,
[DATABASE_NAME],
case when [FILEGROUP_TYPE] is null then 10 when [FILEGROUP_TYPE] = 'Log' then 0 else 1 end


print 'Total by Disk, Database, and Filepath'
select
[DISK]= isnull([DISK],''),
[DATABASE_NAME]= isnull([DATABASE_NAME],''),
[FILEPATH]= isnull([FILEPATH],''),
FILE_SIZE= sum(FILE_SIZE),
FILE_SIZE_USED= sum(FILE_SIZE_USED),
FILE_SIZE_UNUSED= sum(FILE_SIZE_UNUSED),
FILE_USED_PCT=
convert(numeric(5,1),round(
case
when sum(a.[FILE_SIZE]) is null or sum(a.[FILE_SIZE]) = 0
then NULL
else (100.00000*sum(a.[FILE_SIZE_USED]))/(1.00000*sum(a.[FILE_SIZE]))
end ,1)) ,
DATA_SIZE= sum(DATA_SIZE),
DATA_SIZE_USED= sum(DATA_SIZE_USED),
DATA_SIZE_UNUSED= sum(DATA_SIZE_UNUSED),
LOG_SIZE= sum(LOG_SIZE),
LOG_SIZE_USED= sum(LOG_SIZE_USED),
LOG_SIZE_UNUSED= sum(LOG_SIZE_UNUSED)
from
#DB_INFO a
group by
[DISK],
[DATABASE_NAME],
[FILEPATH]
with rollup
order by
case when [DISK] is null then 1 else 0 end ,
[DISK],
case when [DATABASE_NAME] is null then 1 else 0 end ,
[DATABASE_NAME],
case when [FILEPATH] is null then 1 else 0 end ,
[FILEPATH]



print 'Total by Disk and Database'
select
[DISK]= isnull([DISK],''),
[DATABASE_NAME]= isnull([DATABASE_NAME],''),
FILE_SIZE= sum(FILE_SIZE),
FILE_SIZE_USED= sum(FILE_SIZE_USED),
FILE_SIZE_UNUSED= sum(FILE_SIZE_UNUSED),
FILE_USED_PCT=
convert(numeric(5,1),round(
case
when sum(a.[FILE_SIZE]) is null or sum(a.[FILE_SIZE]) = 0
then NULL
else (100.00000*sum(a.[FILE_SIZE_USED]))/(1.00000*sum(a.[FILE_SIZE]))
end ,1)) ,
DATA_SIZE= sum(DATA_SIZE),
DATA_SIZE_USED= sum(DATA_SIZE_USED),
DATA_SIZE_UNUSED= sum(DATA_SIZE_UNUSED),
LOG_SIZE= sum(LOG_SIZE),
LOG_SIZE_USED= sum(LOG_SIZE_USED),
LOG_SIZE_USED= sum(LOG_SIZE_UNUSED)
from
#DB_INFO a
group by
[DISK],
[DATABASE_NAME]
with rollup
order by
case when [DISK] is null then 1 else 0 end ,
[DISK],
case when [DATABASE_NAME] is null then 1 else 0 end ,
[DATABASE_NAME]



print 'Total by Disk'
select
[DISK]= isnull([DISK],''),
FILE_SIZE= sum(FILE_SIZE),
FILE_SIZE_USED= sum(FILE_SIZE_USED),
FILE_SIZE_UNUSED= sum(FILE_SIZE_UNUSED),
FILE_USED_PCT=
convert(numeric(5,1),round(
case
when sum(a.[FILE_SIZE]) is null or sum(a.[FILE_SIZE]) = 0
then NULL
else (100.00000*sum(a.[FILE_SIZE_USED]))/(1.00000*sum(a.[FILE_SIZE]))
end ,1)) ,
DATA_SIZE= sum(DATA_SIZE),
DATA_SIZE_USED= sum(DATA_SIZE_USED),
DATA_SIZE_UNUSED= sum(DATA_SIZE_UNUSED),
LOG_SIZE= sum(LOG_SIZE),
LOG_SIZE_USED= sum(LOG_SIZE_USED),
LOG_SIZE_USED= sum(LOG_SIZE_UNUSED)
from
#DB_INFO a
group by
[DISK]
with rollup
order by
case when [DISK] is null then 1 else 0 end ,
[DISK]


print 'Total by Database'
select
--[Server]= convert(varchar(20),@@servername),
[DATABASE_NAME]= isnull([DATABASE_NAME],'** Total **'),
FILE_SIZE= sum(FILE_SIZE),
FILE_SIZE_USED= sum(FILE_SIZE_USED),
FILE_SIZE_UNUSED= sum(FILE_SIZE_UNUSED),
FILE_USED_PCT=
convert(numeric(5,1),round(
case
when sum(a.[FILE_SIZE]) is null or sum(a.[FILE_SIZE]) = 0
then NULL
else (100.00000*sum(a.[FILE_SIZE_USED]))/(1.00000*sum(a.[FILE_SIZE]))
end ,1)) ,
DATA_SIZE= sum(DATA_SIZE),
DATA_SIZE_USED= sum(DATA_SIZE_USED),
DATA_SIZE_UNUSED= sum(DATA_SIZE_UNUSED),
LOG_SIZE= sum(LOG_SIZE),
LOG_SIZE_USED= sum(LOG_SIZE_USED),
LOG_SIZE_UNUSED= sum(LOG_SIZE_UNUSED)
from
#DB_INFO A
group by
[DATABASE_NAME]
with rollup
order by
case when [DATABASE_NAME] is null then 1 else 0 end ,
[DATABASE_NAME]





CODO ERGO SUM

View 1 Replies View Related

Information On Installing 'QMF' In SQL Server On Win2000?

Jul 20, 2005

Hello,I am installing SAP R/3 on Win2000/SQL Server. There is a CD with theSQL Server RDBMS, as well as another one with SP 3A (Both are fromSAP). According to the SAP installation manual, after installing thoseI have to install 'QMF' for SQL Server. It indicates to checkMicrosoft's documentation on installing QMF on SQL Server. I searchedMicrosoft's Website, but I did not find any information on QMF.Any ideas on the procedure involved, where it is documented, etc..would be greatly appreciated.Thanks,SAP BASIS Consultant

View 1 Replies View Related

Log Information For SQL Server Agent Jobs.

Dec 12, 2007



Hi Guys,


I am not sure if this is the right place to put a question on SQL Server Agent.

I have scheduled some SSIS Jobs using the SQL Server Agent, and wanted to know how can I view detailed log information on how the Job ran (particularly Failure Information).

The information in the Log File Viewer to see the job execution log doesnt seem to help much - as it only says weather the Job Failed or Succeeded.

I need to see the reason and/or the step in a job where it failed!

Can someone help me out with some insight into this....


Thanks
Pramod

View 6 Replies View Related

Sql Server 2005 Job Failure Information

Dec 18, 2007

Hi,
I have scheduled a job that runs every minute.
If the job does not succeed, then I would like my front end application to be notified.
I am not sure if this is a reasonable way but I am thinking of somehow
populating a table (Only if the scheduled job fails) in sql server and then read that table every minute from the front end application.
So, is it possible to populate a table if a job fails?
I do not see any options for this in the properties of the job.
Thanks

View 6 Replies View Related

License Information In SQL Server 2005

Jan 17, 2008

How do we determine on a SQL 2005 server what license type was selected during the install? Where is the informationkept and how it is tracked by SQL Server 2005.

Thanks in Advance.

Admindba

View 3 Replies View Related

Central Store For Server Registration Information

Jun 26, 2001

Has anyone had any luck trying to use a central store for server registration information? I'm following the steps but it doesn't seem to work.

I receive the following error: The Server Registration Information could not be loaded - Registry read error:2

Any help is appreciated.

View 1 Replies View Related

SQL Server 2012 :: Inserting Information From One Table Into Another

Aug 12, 2015

I am working on moving information from one of our databases into a newer one the company has recently setup. I am working in MS SQL Server 2012 and am trying to Inset/Update (depending on the information) a part table. I will list the two tables I am working on as Old (where I am getting the information) and New (where it is to be inserted into).

The old table has about 250 columns of information, most of which is not needed. The needed information is as follows: Name, ID, Component1, Component1_PIN, Component1_SN, Component1_Description, Component2, Component2_PIN, Component2_SN. The component section repeats up to Component12.

The new table has columns setup as such: Name, ID, Case, CasePIN, CaseSN, Case_Desc, Processor, ProcessorPIN, ProcessorSN, Processor_Description, Memory, MemoryPIN, MemorySN, Memory_Description, etc.

The issue I am having is that in the old table each component can have Case, Processor, Memory, etc in that one column. I need to insert Case, Memory, etc into the correct column in the new table while keeping intact the rest of the information.

Example:

Old Table
Name | ID | Component1 | Component1_PIN | Component1_SN | Component1_Description | Component2 | Component2_PIN | Component2_SN | Component2_Description
Nest8 | 5682 | Case | 901834 | 237848117 | Black, rectangular | Memory | 9081234 | 5398798134 | NULL
Nest8 | 5978 | Case | 901463 | 237848138 | Black, rectangular | Processor | 2394875 | 2903857809 | Bad
Reds3 | 5683 | Memory | 2405 | 89752342 | Crucial | HardDrive | 92387595 | 457982234 | NULL
Bass | 5644 | HardDrive | 79872346 | 5321675789 | NULL | Case | 10984528 | 3498769872 | NULL

I am not sure how to loop through and grab each part and place it in the column it needs to be while keeping it with the ID.

View 4 Replies View Related

Select Statement To Pull SQL Server Information

May 6, 2008

Sorry if this is rudimentary.

I need a select statement to retrieve what version of sql server is running and whether it is enterprise or standard.

I know I could just right click but I have hundreds of servers to go through so this should save alot of time.

Thanks,
Kraig

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved