Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Thursday, March 22, 2012

Database File size monitor

What are folks using to monitor database file sizes? I have been tasked
with writing a script to monitor our db's (Yes I know there are growth
controls, etc...). I was hoping there maybe a way to keep track of this via
some widget dashboard, etc... I have Solarwinds and will look at importing
SAN mibs, but still would like to hear thoughts from others.
--
Paul Bergson
MVP - Directory Services
MCT, MCSE, MCSA, Security+, BS CSci
2003, 2000 (Early Achiever), NT
http://www.pbbergs.com
Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.Take a look at sp_helpdb. It'll show you how the db sizes are calculated.
Instead of just displaying the values, store then in a table and then you'll
be able to see how fast you db is growing each day, month, minute, hour...or
whatever.
--
MG
"Paul Bergson [MVP-DS]" wrote:
> What are folks using to monitor database file sizes? I have been tasked
> with writing a script to monitor our db's (Yes I know there are growth
> controls, etc...). I was hoping there maybe a way to keep track of this via
> some widget dashboard, etc... I have Solarwinds and will look at importing
> SAN mibs, but still would like to hear thoughts from others.
> --
> Paul Bergson
> MVP - Directory Services
> MCT, MCSE, MCSA, Security+, BS CSci
> 2003, 2000 (Early Achiever), NT
> http://www.pbbergs.com
> Please no e-mails, any questions should be posted in the NewsGroup
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>|||DECLARE @.DB sysname
DECLARE @.SQL nvarchar(255)
if exists ( select * from tempdb..sysobjects where name LIKE
'#FileStats__%' ) drop table #FileStats
CREATE TABLE #FileStats(
[FileId] INT,
[FileGroup] INT,
[TotalExtents] INT,
[UsedExtents] INT,
[Name] sysname,
[Filename] varchar(255)
)
DECLARE @.FileStats TABLE (
[FileId] INT,
[FileGroup] INT,
[TotalExtents] INT,
[UsedExtents] INT,
[Name] sysname,
[Filename] varchar(255)
)
DECLARE cDatabases CURSOR FOR
SELECT QUOTENAME(sdb.name)
FROM master.dbo.sysdatabases sdb
WHERE status & 32 != 32
AND status & 64 != 64
AND status & 128 != 128
AND status & 256 != 256
AND status & 512 != 512
AND status & 1024 != 1024
AND status & 4096 != 4096
AND status & 32768 !=32768
OPEN cDatabases
FETCH FROM cDatabases INTO @.DB
WHILE (@.@.FETCH_STATUS = 0)
BEGIN
DELETE FROM #FileStats
SET @.SQL = 'USE ' + @.DB + '; INSERT INTO #FileStats EXEC (''DBCC
SHOWFILESTATS'')'
EXEC (@.SQL)
UPDATE #FileStats SET name = @.DB
INSERT INTO @.FileStats SELECT * FROM #FileStats
FETCH FROM cDatabases INTO @.DB
END
CLOSE cDatabases
DEALLOCATE cDatabases
SELECT
[Name]
,[TotalExtents]*64/1024. AS TotalExtInMB
,[UsedExtents]*64/1024. AS UsedExtInMB
,([TotalExtents] - [UsedExtents]) / 16. AS UnAllocExtInMB --* 64 /
1024. AS UnAllocExtInMB
,CAST(FLOOR(ROUND([UsedExtents] * 100. / [TotalExtents], 0)) AS
VARCHAR(3)) + '%' AS Pct_Full
FROM @.FileStats
ORDER BY TotalExtInMB DESC
--exec sp_spaceused
DBCC sqlperf(logspace)
"Paul Bergson [MVP-DS]" <pbergson@.allete_nospam.com> wrote in message
news:uxH3fPY8HHA.2004@.TK2MSFTNGP06.phx.gbl...
> What are folks using to monitor database file sizes? I have been tasked
> with writing a script to monitor our db's (Yes I know there are growth
> controls, etc...). I was hoping there maybe a way to keep track of this
> via some widget dashboard, etc... I have Solarwinds and will look at
> importing SAN mibs, but still would like to hear thoughts from others.
> --
> Paul Bergson
> MVP - Directory Services
> MCT, MCSE, MCSA, Security+, BS CSci
> 2003, 2000 (Early Achiever), NT
> http://www.pbbergs.com
> Please no e-mails, any questions should be posted in the NewsGroup
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||I use a custom script based around aggregating data from DBCC SHOWFILESTATS.
--
Geoff N. Hiten
Senior SQL Infrastructure Consultant
Microsoft SQL Server MVP
"Paul Bergson [MVP-DS]" <pbergson@.allete_nospam.com> wrote in message
news:uxH3fPY8HHA.2004@.TK2MSFTNGP06.phx.gbl...
> What are folks using to monitor database file sizes? I have been tasked
> with writing a script to monitor our db's (Yes I know there are growth
> controls, etc...). I was hoping there maybe a way to keep track of this
> via some widget dashboard, etc... I have Solarwinds and will look at
> importing SAN mibs, but still would like to hear thoughts from others.
> --
> Paul Bergson
> MVP - Directory Services
> MCT, MCSE, MCSA, Security+, BS CSci
> 2003, 2000 (Early Achiever), NT
> http://www.pbbergs.com
> Please no e-mails, any questions should be posted in the NewsGroup
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||Thanks for your feedback, it is appreciated.
--
Paul Bergson
MVP - Directory Services
MCT, MCSE, MCSA, Security+, BS CSci
2003, 2000 (Early Achiever), NT
http://www.pbbergs.com
Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.
"Hurme" <michael.geles@.thomson.com> wrote in message
news:F8CA1619-B919-45B9-9C76-75DF14160A66@.microsoft.com...
> Take a look at sp_helpdb. It'll show you how the db sizes are calculated.
> Instead of just displaying the values, store then in a table and then
> you'll
> be able to see how fast you db is growing each day, month, minute,
> hour...or
> whatever.
> --
> MG
>
> "Paul Bergson [MVP-DS]" wrote:
>> What are folks using to monitor database file sizes? I have been tasked
>> with writing a script to monitor our db's (Yes I know there are growth
>> controls, etc...). I was hoping there maybe a way to keep track of this
>> via
>> some widget dashboard, etc... I have Solarwinds and will look at
>> importing
>> SAN mibs, but still would like to hear thoughts from others.
>> --
>> Paul Bergson
>> MVP - Directory Services
>> MCT, MCSE, MCSA, Security+, BS CSci
>> 2003, 2000 (Early Achiever), NT
>> http://www.pbbergs.com
>> Please no e-mails, any questions should be posted in the NewsGroup
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>|||Thanks for your feedback, it is appreciated.
--
Paul Bergson
MVP - Directory Services
MCT, MCSE, MCSA, Security+, BS CSci
2003, 2000 (Early Achiever), NT
http://www.pbbergs.com
Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jay" <nospam@.nospam.org> wrote in message
news:uUlhoBZ8HHA.5012@.TK2MSFTNGP02.phx.gbl...
> DECLARE @.DB sysname
> DECLARE @.SQL nvarchar(255)
> if exists ( select * from tempdb..sysobjects where name LIKE
> '#FileStats__%' ) drop table #FileStats
> CREATE TABLE #FileStats(
> [FileId] INT,
> [FileGroup] INT,
> [TotalExtents] INT,
> [UsedExtents] INT,
> [Name] sysname,
> [Filename] varchar(255)
> )
> DECLARE @.FileStats TABLE (
> [FileId] INT,
> [FileGroup] INT,
> [TotalExtents] INT,
> [UsedExtents] INT,
> [Name] sysname,
> [Filename] varchar(255)
> )
> DECLARE cDatabases CURSOR FOR
> SELECT QUOTENAME(sdb.name)
> FROM master.dbo.sysdatabases sdb
> WHERE status & 32 != 32
> AND status & 64 != 64
> AND status & 128 != 128
> AND status & 256 != 256
> AND status & 512 != 512
> AND status & 1024 != 1024
> AND status & 4096 != 4096
> AND status & 32768 !=32768
> OPEN cDatabases
> FETCH FROM cDatabases INTO @.DB
> WHILE (@.@.FETCH_STATUS = 0)
> BEGIN
> DELETE FROM #FileStats
> SET @.SQL = 'USE ' + @.DB + '; INSERT INTO #FileStats EXEC (''DBCC
> SHOWFILESTATS'')'
> EXEC (@.SQL)
> UPDATE #FileStats SET name = @.DB
> INSERT INTO @.FileStats SELECT * FROM #FileStats
> FETCH FROM cDatabases INTO @.DB
> END
> CLOSE cDatabases
> DEALLOCATE cDatabases
> SELECT
> [Name]
> ,[TotalExtents]*64/1024. AS TotalExtInMB
> ,[UsedExtents]*64/1024. AS UsedExtInMB
> ,([TotalExtents] - [UsedExtents]) / 16. AS UnAllocExtInMB --* 64 /
> 1024. AS UnAllocExtInMB
> ,CAST(FLOOR(ROUND([UsedExtents] * 100. / [TotalExtents], 0)) AS
> VARCHAR(3)) + '%' AS Pct_Full
> FROM @.FileStats
> ORDER BY TotalExtInMB DESC
> --exec sp_spaceused
> DBCC sqlperf(logspace)
> "Paul Bergson [MVP-DS]" <pbergson@.allete_nospam.com> wrote in message
> news:uxH3fPY8HHA.2004@.TK2MSFTNGP06.phx.gbl...
>> What are folks using to monitor database file sizes? I have been tasked
>> with writing a script to monitor our db's (Yes I know there are growth
>> controls, etc...). I was hoping there maybe a way to keep track of this
>> via some widget dashboard, etc... I have Solarwinds and will look at
>> importing SAN mibs, but still would like to hear thoughts from others.
>> --
>> Paul Bergson
>> MVP - Directory Services
>> MCT, MCSE, MCSA, Security+, BS CSci
>> 2003, 2000 (Early Achiever), NT
>> http://www.pbbergs.com
>> Please no e-mails, any questions should be posted in the NewsGroup
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>|||Thanks for your feedback, it is appreciated.
--
Paul Bergson
MVP - Directory Services
MCT, MCSE, MCSA, Security+, BS CSci
2003, 2000 (Early Achiever), NT
http://www.pbbergs.com
Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.
"Geoff N. Hiten" <SQLCraftsman@.gmail.com> wrote in message
news:ON2b3EZ8HHA.5752@.TK2MSFTNGP04.phx.gbl...
>I use a custom script based around aggregating data from DBCC
>SHOWFILESTATS.
> --
> Geoff N. Hiten
> Senior SQL Infrastructure Consultant
> Microsoft SQL Server MVP
>
> "Paul Bergson [MVP-DS]" <pbergson@.allete_nospam.com> wrote in message
> news:uxH3fPY8HHA.2004@.TK2MSFTNGP06.phx.gbl...
>> What are folks using to monitor database file sizes? I have been tasked
>> with writing a script to monitor our db's (Yes I know there are growth
>> controls, etc...). I was hoping there maybe a way to keep track of this
>> via some widget dashboard, etc... I have Solarwinds and will look at
>> importing SAN mibs, but still would like to hear thoughts from others.
>> --
>> Paul Bergson
>> MVP - Directory Services
>> MCT, MCSE, MCSA, Security+, BS CSci
>> 2003, 2000 (Early Achiever), NT
>> http://www.pbbergs.com
>> Please no e-mails, any questions should be posted in the NewsGroup
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>

Wednesday, March 21, 2012

Database Errors

I'm trying to script a SQL server 7 database using the
tool in EM. Every time I try I get error 220 Arithmetic
overflow error for data type smallint, value = 65535.
It's quite clearly correct in that it is out of range,
what I don't understand is why and what I can do to
resolve this error. After I found this out I discovered
that all the databases on this server give the same error
when I try to look at their properties using enterprise
manager.
Does anyone have any ideas what is causing this and how I
can prevent it
replies please to elwoosAThotmailDOTcom
thanksTry to script the objects seperately and see where this error occurs.
Other way to scritping:
http://www.nigelrivett.net/DMOScripting.html
http://www.nigelrivett.net/DMOScriptAllDatabases.html
"elwoos" wrote:

> I'm trying to script a SQL server 7 database using the
> tool in EM. Every time I try I get error 220 Arithmetic
> overflow error for data type smallint, value = 65535.
> It's quite clearly correct in that it is out of range,
> what I don't understand is why and what I can do to
> resolve this error. After I found this out I discovered
> that all the databases on this server give the same error
> when I try to look at their properties using enterprise
> manager.
> Does anyone have any ideas what is causing this and how I
> can prevent it
> replies please to elwoosAThotmailDOTcom
> thanks
>

Database Errors

I'm trying to script a SQL server 7 database using the
tool in EM. Every time I try I get error 220 Arithmetic
overflow error for data type smallint, value = 65535.
It's quite clearly correct in that it is out of range,
what I don't understand is why and what I can do to
resolve this error. After I found this out I discovered
that all the databases on this server give the same error
when I try to look at their properties using enterprise
manager.
Does anyone have any ideas what is causing this and how I
can prevent it
replies please to elwoosAThotmailDOTcom
thanks
Try to script the objects seperately and see where this error occurs.
Other way to scritping:
http://www.nigelrivett.net/DMOScripting.html
http://www.nigelrivett.net/DMOScriptAllDatabases.html
"elwoos" wrote:

> I'm trying to script a SQL server 7 database using the
> tool in EM. Every time I try I get error 220 Arithmetic
> overflow error for data type smallint, value = 65535.
> It's quite clearly correct in that it is out of range,
> what I don't understand is why and what I can do to
> resolve this error. After I found this out I discovered
> that all the databases on this server give the same error
> when I try to look at their properties using enterprise
> manager.
> Does anyone have any ideas what is causing this and how I
> can prevent it
> replies please to elwoosAThotmailDOTcom
> thanks
>

database error -help

I'm using sqlserver 2000 and when i go to enterprise
manager and click on one of the database it is giving me
internet explorer script error. it is refering to
c:/programfiles/mssql2000/80/tools/bin/resources/1033/sqlmm
c.rll/tabs.html
Can anyone help please?Try switching from taskpad view to anything else, select
the database (should be no error), then go back to taskpad
view. Of the top of my head, this is the one issue I can
think of...
>--Original Message--
>I'm using sqlserver 2000 and when i go to enterprise
>manager and click on one of the database it is giving me
>internet explorer script error. it is refering to
>c:/programfiles/mssql2000/80/tools/bin/resources/1033/sqlm
m
>c.rll/tabs.html
>Can anyone help please?
>.
>

Monday, March 19, 2012

Database dump and load script

Hi,
Is anyone using a custom script, or anything else that helps allow software
developer's do their own database dump and loads rather than having to ask a
DBA every time? What are people using to allow this functionality?
We are looking to move this task from a DBA responsibility to allow for the
users to do their own database dumps and loads in the test and development
environments. The one problem we have is that the databases were not all
standardized to have the exact file path names when they are created. For
example, F:\MSSQL\data\<filename>.mdf. Some of them might be
F:\MSSQL\default\data\<filename>.mdf, etc.
Does anyone have this capability automated for what I am looking for?
Thanks for any feedback.
CynthiaWe wrote some scripts that perform these operations. Essentially, a control
table is created and populated for each DB. When a restore need to be
performed, a row is inserted into a table where a recurring job picks it up
and looks into the control tables for the necessary information. The job
generates on OSQL script and prevents the need for the developers to have
those sorts of rights necessesary to perform restores(may not be an issue for
you)
Jeff
"Cynthia" wrote:
> Hi,
> Is anyone using a custom script, or anything else that helps allow software
> developer's do their own database dump and loads rather than having to ask a
> DBA every time? What are people using to allow this functionality?
> We are looking to move this task from a DBA responsibility to allow for the
> users to do their own database dumps and loads in the test and development
> environments. The one problem we have is that the databases were not all
> standardized to have the exact file path names when they are created. For
> example, F:\MSSQL\data\<filename>.mdf. Some of them might be
> F:\MSSQL\default\data\<filename>.mdf, etc.
> Does anyone have this capability automated for what I am looking for?
> Thanks for any feedback.
> Cynthia

Database dump and load script

Hi,
Is anyone using a custom script, or anything else that helps allow software
developer's do their own database dump and loads rather than having to ask a
DBA every time? What are people using to allow this functionality?
We are looking to move this task from a DBA responsibility to allow for the
users to do their own database dumps and loads in the test and development
environments. The one problem we have is that the databases were not all
standardized to have the exact file path names when they are created. For
example, F:\MSSQL\data\<filename>.mdf. Some of them might be
F:\MSSQL\default\data\<filename>.mdf, etc.
Does anyone have this capability automated for what I am looking for?
Thanks for any feedback.
Cynthia
We wrote some scripts that perform these operations. Essentially, a control
table is created and populated for each DB. When a restore need to be
performed, a row is inserted into a table where a recurring job picks it up
and looks into the control tables for the necessary information. The job
generates on OSQL script and prevents the need for the developers to have
those sorts of rights necessesary to perform restores(may not be an issue for
you)
Jeff
"Cynthia" wrote:

> Hi,
> Is anyone using a custom script, or anything else that helps allow software
> developer's do their own database dump and loads rather than having to ask a
> DBA every time? What are people using to allow this functionality?
> We are looking to move this task from a DBA responsibility to allow for the
> users to do their own database dumps and loads in the test and development
> environments. The one problem we have is that the databases were not all
> standardized to have the exact file path names when they are created. For
> example, F:\MSSQL\data\<filename>.mdf. Some of them might be
> F:\MSSQL\default\data\<filename>.mdf, etc.
> Does anyone have this capability automated for what I am looking for?
> Thanks for any feedback.
> Cynthia

Database dump and load script

Hi,
Is anyone using a custom script, or anything else that helps allow software
developer's do their own database dump and loads rather than having to ask a
DBA every time? What are people using to allow this functionality?
We are looking to move this task from a DBA responsibility to allow for the
users to do their own database dumps and loads in the test and development
environments. The one problem we have is that the databases were not all
standardized to have the exact file path names when they are created. For
example, F:\MSSQL\data\<filename>.mdf. Some of them might be
F:\MSSQL\default\data\<filename>.mdf, etc.
Does anyone have this capability automated for what I am looking for?
Thanks for any feedback.
CynthiaWe wrote some scripts that perform these operations. Essentially, a control
table is created and populated for each DB. When a restore need to be
performed, a row is inserted into a table where a recurring job picks it up
and looks into the control tables for the necessary information. The job
generates on OSQL script and prevents the need for the developers to have
those sorts of rights necessesary to perform restores(may not be an issue fo
r
you)
Jeff
"Cynthia" wrote:

> Hi,
> Is anyone using a custom script, or anything else that helps allow softwar
e
> developer's do their own database dump and loads rather than having to ask
a
> DBA every time? What are people using to allow this functionality?
> We are looking to move this task from a DBA responsibility to allow for th
e
> users to do their own database dumps and loads in the test and development
> environments. The one problem we have is that the databases were not all
> standardized to have the exact file path names when they are created. For
> example, F:\MSSQL\data\<filename>.mdf. Some of them might be
> F:\MSSQL\default\data\<filename>.mdf, etc.
> Does anyone have this capability automated for what I am looking for?
> Thanks for any feedback.
> Cynthia

Friday, February 24, 2012

Database design problem

I have a problem when the foreign key in a table points to the primary
key in the same table. Here is the script to create the tables:
CREATE TABLE [Folder] (
[FolderID] [int] NOT NULL ,
[MasterFolderID] [int] NULL ,
CONSTRAINT [PK_Folder] PRIMARY KEY CLUSTERED
(
[FolderID]
) ON [PRIMARY] ,
CONSTRAINT [FK_Folder_Folder] FOREIGN KEY
(
[MasterFolderID]
) REFERENCES [Folder] (
[FolderID]
)
) ON [PRIMARY]
GO
CREATE TABLE [File] (
[FileID] [int] NOT NULL ,
[FolderID] [int] NOT NULL ,
[FileSize] [int] NOT NULL ,
CONSTRAINT [PK_File] PRIMARY KEY CLUSTERED
(
[FileID]
) ON [PRIMARY] ,
CONSTRAINT [FK_File_Folder] FOREIGN KEY
(
[FolderID]
) REFERENCES [Folder] (
[FolderID]
)
) ON [PRIMARY]
GO
So I have a "Folder" table as the master and a "File" table as the
detail, but the Folder table also has a one to many relationship to
itself.
Then I have the following data in these two tables:
INSERT INTO [Folder]([FolderID])
VALUES(1)
INSERT INTO [Folder]([FolderID], [MasterFolderID])
VALUES(2,1)
INSERT INTO [File]([FileID], [FolderID], [FileSize])
VALUES(1, 1, 10)
INSERT INTO [File]([FileID], [FolderID], [FileSize])
VALUES(2, 2, 10)
The "File" table has a field called FileSize that needs to be added to
give you the size of each folder. Here is the sql statement I use for
that:
Select FolderID,
(Select Sum(FileSize) From [File] Where [File].FolderID =
Folder.FolderID) As Size
From Folder
The problem with the above statement is that it only adds sizes of the
files in the folder and not the sizes of the folders in a folder.
I hope someone understands my problem and would realy appreciate some
help.To make sure:
Folder 1
File 1a 10 kb
File 1b 10 kb
Folder 1.1
File 1.1a 10 kb
File 1.1b 10 kb
You want the following:
Folder 1 40kb
Folder 1.1 20kb
Right?
That is done via recursion. Unfortunately, there is no simple way to
accomplish this in T-SQL (at least not until SQL Server 2005). To accomplish
this, you will have to curse through the hierarchy and create the aggregates
.
My advice, esp. if this is a large app: Denormalize slightly to add the size
to the folder. Then create a routine that curses through and gets the total.
Finally, create a trigger that updates totals when a new record is added.
NOTE: This assumes that this is not an oft updated/inserted table. If it is,
you can still get totals for the files and recude the amount of recursion
work necessary to get the final tally for each directory (reduce by one "sum
"
aggregate).
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Pierre" wrote:

> I have a problem when the foreign key in a table points to the primary
> key in the same table. Here is the script to create the tables:
> CREATE TABLE [Folder] (
> [FolderID] [int] NOT NULL ,
> [MasterFolderID] [int] NULL ,
> CONSTRAINT [PK_Folder] PRIMARY KEY CLUSTERED
> (
> [FolderID]
> ) ON [PRIMARY] ,
> CONSTRAINT [FK_Folder_Folder] FOREIGN KEY
> (
> [MasterFolderID]
> ) REFERENCES [Folder] (
> [FolderID]
> )
> ) ON [PRIMARY]
> GO
>
> CREATE TABLE [File] (
> [FileID] [int] NOT NULL ,
> [FolderID] [int] NOT NULL ,
> [FileSize] [int] NOT NULL ,
> CONSTRAINT [PK_File] PRIMARY KEY CLUSTERED
> (
> [FileID]
> ) ON [PRIMARY] ,
> CONSTRAINT [FK_File_Folder] FOREIGN KEY
> (
> [FolderID]
> ) REFERENCES [Folder] (
> [FolderID]
> )
> ) ON [PRIMARY]
> GO
> So I have a "Folder" table as the master and a "File" table as the
> detail, but the Folder table also has a one to many relationship to
> itself.
> Then I have the following data in these two tables:
>
> INSERT INTO [Folder]([FolderID])
> VALUES(1)
> INSERT INTO [Folder]([FolderID], [MasterFolderID])
> VALUES(2,1)
> INSERT INTO [File]([FileID], [FolderID], [FileSize])
> VALUES(1, 1, 10)
> INSERT INTO [File]([FileID], [FolderID], [FileSize])
> VALUES(2, 2, 10)
>
> The "File" table has a field called FileSize that needs to be added to
> give you the size of each folder. Here is the sql statement I use for
> that:
> Select FolderID,
> (Select Sum(FileSize) From [File] Where [File].FolderID =
> Folder.FolderID) As Size
> From Folder
> The problem with the above statement is that it only adds sizes of the
> files in the folder and not the sizes of the folders in a folder.
> I hope someone understands my problem and would realy appreciate some
> help.
>