Is there any way I can join all the information produced by this into a single output rather than multiple outputs
EXEC sp_MSforeachtable @.command1=" EXEC sp_spaceused '?'"
Like this
Listing_Images 43 16 KB 8 KB 8 KB 0 KB
User 3 16 KB 8 KB 8 KB 0 KB
I want to fill a gridview in ASP but don't know how to deal with data produced through multiple queriesLook at the code of sp_spaceused and build what you need
select name=object_name(i.id)
,rows=sum(case when indid<2 then rows else 0 end)
,reservKB=convert(int,sum(reserved)/.125)
,dataKB=convert(int,sum(case
when indid<2 then dpages
when indid=255 then isnull(used,0)
else 0 end)/.125)
,indexKB=convert(int,(sum(used)-sum(case
when indid<2 then dpages
when indid=255 then isnull(used,0)
else 0 end))/.125)
,unusedKB=convert(int,(sum(reserved)-sum(used))/.125)
from sysindexes i join sysobjects o on i.id=o.id
where indid in (0, 1, 255)
and o.xtype='U'
-- and id in (object_id('Listing_Images'), object_id('User'))
group by i.id
else
create table #t1 (Table_name varchar(128), Records varchar(11)
,reservedKB varchar(18), dataKB varchar(18), index_sizeKB varchar(18)
,unused varchar(18))
insert #t1 exec sp_spaceused Listing_Images
insert #t1 exec sp_spaceused User
select * from #t1
drop table #t1|||I see what you mean, Ive done the same thing at an application level where it executes and inserts each result as a row,
While myReader.Read
Dim newRow As DataRow = dt.NewRow()
newRow("name") = myReader("name").ToString
newRow("rows") = myReader("rows").ToString
newRow("data") = myReader("data").ToString
newRow("index_size") = myReader("index_size").ToString
newRow("reserved") = myReader("reserved").ToString
newRow("unused") = myReader("unused").ToString
dt.Rows.Add(newRow)
Total_IndexSize = Total_IndexSize + Convert.ToInt32(myReader("index_size").ToString().Split(SpaceDelimiter)(0))
Total_DataSize = Total_DataSize + Convert.ToInt32(myReader("data").ToString().Split(SpaceDelimiter)(0))
Total_ReservedSpace = Total_ReservedSpace + Convert.ToInt32(myReader("reserved").ToString().Split(SpaceDelimiter)(0))
Total_UnusedSpace = Total_UnusedSpace + Convert.ToInt32(myReader("unused").ToString().Split(SpaceDelimiter)(0))
End While|||Updated my previous post
Showing posts with label single. Show all posts
Showing posts with label single. Show all posts
Thursday, March 22, 2012
Database size
Sunday, February 19, 2012
database prioritizing
I have a quick question. I have not been able to find any information on
database prioritizing. I have several databases on a single server, but one
need to have processing priority over the others. Is it possible? If anyone
has or knows of somewhere I can read up on this subject it would be
appreciated
Thanks,
Rick
There's no such feature in SQL Server. Generally, you try to tweak the regular stuff to get it as
efficient as possible.
If you need to do some prioritizing, you can opt for several instances on one machine. For an
instance, you can define processor affinity, memory etc.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Rick" <Rick@.discussions.microsoft.com> wrote in message
news:E139B520-FAA9-463F-A99D-10BD95646085@.microsoft.com...
>I have a quick question. I have not been able to find any information on
> database prioritizing. I have several databases on a single server, but one
> need to have processing priority over the others. Is it possible? If anyone
> has or knows of somewhere I can read up on this subject it would be
> appreciated
> Thanks,
> Rick
>
database prioritizing. I have several databases on a single server, but one
need to have processing priority over the others. Is it possible? If anyone
has or knows of somewhere I can read up on this subject it would be
appreciated
Thanks,
Rick
There's no such feature in SQL Server. Generally, you try to tweak the regular stuff to get it as
efficient as possible.
If you need to do some prioritizing, you can opt for several instances on one machine. For an
instance, you can define processor affinity, memory etc.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Rick" <Rick@.discussions.microsoft.com> wrote in message
news:E139B520-FAA9-463F-A99D-10BD95646085@.microsoft.com...
>I have a quick question. I have not been able to find any information on
> database prioritizing. I have several databases on a single server, but one
> need to have processing priority over the others. Is it possible? If anyone
> has or knows of somewhere I can read up on this subject it would be
> appreciated
> Thanks,
> Rick
>
Labels:
database,
databases,
microsoft,
mysql,
ondatabase,
oracle,
prioritizing,
server,
single,
sql
database prioritizing
I have a quick question. I have not been able to find any information on
database prioritizing. I have several databases on a single server, but one
need to have processing priority over the others. Is it possible? If anyon
e
has or knows of somewhere I can read up on this subject it would be
appreciated
Thanks,
RickThere's no such feature in SQL Server. Generally, you try to tweak the regul
ar stuff to get it as
efficient as possible.
If you need to do some prioritizing, you can opt for several instances on on
e machine. For an
instance, you can define processor affinity, memory etc.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Rick" <Rick@.discussions.microsoft.com> wrote in message
news:E139B520-FAA9-463F-A99D-10BD95646085@.microsoft.com...
>I have a quick question. I have not been able to find any information on
> database prioritizing. I have several databases on a single server, but o
ne
> need to have processing priority over the others. Is it possible? If any
one
> has or knows of somewhere I can read up on this subject it would be
> appreciated
> Thanks,
> Rick
>
database prioritizing. I have several databases on a single server, but one
need to have processing priority over the others. Is it possible? If anyon
e
has or knows of somewhere I can read up on this subject it would be
appreciated
Thanks,
RickThere's no such feature in SQL Server. Generally, you try to tweak the regul
ar stuff to get it as
efficient as possible.
If you need to do some prioritizing, you can opt for several instances on on
e machine. For an
instance, you can define processor affinity, memory etc.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Rick" <Rick@.discussions.microsoft.com> wrote in message
news:E139B520-FAA9-463F-A99D-10BD95646085@.microsoft.com...
>I have a quick question. I have not been able to find any information on
> database prioritizing. I have several databases on a single server, but o
ne
> need to have processing priority over the others. Is it possible? If any
one
> has or knows of somewhere I can read up on this subject it would be
> appreciated
> Thanks,
> Rick
>
Labels:
database,
databases,
microsoft,
mysql,
ondatabase,
oracle,
prioritizing,
server,
single,
sql
Friday, February 17, 2012
database prioritizing
I have a quick question. I have not been able to find any information on
database prioritizing. I have several databases on a single server, but one
need to have processing priority over the others. Is it possible? If anyone
has or knows of somewhere I can read up on this subject it would be
appreciated
Thanks,
RickThere's no such feature in SQL Server. Generally, you try to tweak the regular stuff to get it as
efficient as possible.
If you need to do some prioritizing, you can opt for several instances on one machine. For an
instance, you can define processor affinity, memory etc.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Rick" <Rick@.discussions.microsoft.com> wrote in message
news:E139B520-FAA9-463F-A99D-10BD95646085@.microsoft.com...
>I have a quick question. I have not been able to find any information on
> database prioritizing. I have several databases on a single server, but one
> need to have processing priority over the others. Is it possible? If anyone
> has or knows of somewhere I can read up on this subject it would be
> appreciated
> Thanks,
> Rick
>
database prioritizing. I have several databases on a single server, but one
need to have processing priority over the others. Is it possible? If anyone
has or knows of somewhere I can read up on this subject it would be
appreciated
Thanks,
RickThere's no such feature in SQL Server. Generally, you try to tweak the regular stuff to get it as
efficient as possible.
If you need to do some prioritizing, you can opt for several instances on one machine. For an
instance, you can define processor affinity, memory etc.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Rick" <Rick@.discussions.microsoft.com> wrote in message
news:E139B520-FAA9-463F-A99D-10BD95646085@.microsoft.com...
>I have a quick question. I have not been able to find any information on
> database prioritizing. I have several databases on a single server, but one
> need to have processing priority over the others. Is it possible? If anyone
> has or knows of somewhere I can read up on this subject it would be
> appreciated
> Thanks,
> Rick
>
Subscribe to:
Posts (Atom)