Hi,
I am wondering what the best way is to go about getting data about
database size (free & used space). I have multiple servers that I
must keep an eye on so I am developing a little application that will
report on the DB and log size but I do not want to go to each server
with enterprise manager or query analyzer to check on them. As far as
log size information I have been using a stored procedure that retuns
results from DBCC SQLPERF(Logspace) but I have not been able to find a
similar function for the database stats. Any ideas?
Paul,
For whatever the current database is the system stored procedures:
sp_spaceused -- shows utilization
sp_helpfile -- shows the file sizes, e.g. the mdf and the ldf, etc.
I use these both to understand what is happening.
Russell Fields
"Paul T." <weluvpaul@.hotmail.com> wrote in message
news:1fe3e09e.0408231149.1aa9225a@.posting.google.c om...
> Hi,
> I am wondering what the best way is to go about getting data about
> database size (free & used space). I have multiple servers that I
> must keep an eye on so I am developing a little application that will
> report on the DB and log size but I do not want to go to each server
> with enterprise manager or query analyzer to check on them. As far as
> log size information I have been using a stored procedure that retuns
> results from DBCC SQLPERF(Logspace) but I have not been able to find a
> similar function for the database stats. Any ideas?
|||Thank you Russel!
Showing posts with label multiple. Show all posts
Showing posts with label multiple. Show all posts
Tuesday, March 27, 2012
Saturday, February 25, 2012
Dates from multiple fields
I have fields that are listed as nvarchar in a table. Field1 contains
the month, Field2 contains the day, Field3 contains the year.
I need to pick stuff off this table with a "date" >= 12/10/2004.
How do you construct the "date" from the 3 fields above?
I've tried cast & converts on it, but have not hit the correct combination.
Any help appreciated.
BCBlasting,
Try:
SELECT <COLUMNS>
FROM <TABLE>
WHERE CAST(CAST(FIELD3+FIELD2+FIELD1 AS CHAR(8)) AS DATETIME) <
ETDATE() -- OR OTHER DATE
HTH
Jerry
"Blasting Cap" <goober@.christian.net> wrote in message
news:uWQkDUl1FHA.1028@.TK2MSFTNGP12.phx.gbl...
>I have fields that are listed as nvarchar in a table. Field1 contains the
>month, Field2 contains the day, Field3 contains the year.
> I need to pick stuff off this table with a "date" >= 12/10/2004.
> How do you construct the "date" from the 3 fields above?
> I've tried cast & converts on it, but have not hit the correct
> combination.
> Any help appreciated.
> BC
>|||concatenate and add '/' between the fields and convert the whole thing to a
datetime
http://sqlservercode.blogspot.com/
"Blasting Cap" wrote:
> I have fields that are listed as nvarchar in a table. Field1 contains
> the month, Field2 contains the day, Field3 contains the year.
> I need to pick stuff off this table with a "date" >= 12/10/2004.
> How do you construct the "date" from the 3 fields above?
> I've tried cast & converts on it, but have not hit the correct combination
.
> Any help appreciated.
> BC
>
the month, Field2 contains the day, Field3 contains the year.
I need to pick stuff off this table with a "date" >= 12/10/2004.
How do you construct the "date" from the 3 fields above?
I've tried cast & converts on it, but have not hit the correct combination.
Any help appreciated.
BCBlasting,
Try:
SELECT <COLUMNS>
FROM <TABLE>
WHERE CAST(CAST(FIELD3+FIELD2+FIELD1 AS CHAR(8)) AS DATETIME) <
ETDATE() -- OR OTHER DATE
HTH
Jerry
"Blasting Cap" <goober@.christian.net> wrote in message
news:uWQkDUl1FHA.1028@.TK2MSFTNGP12.phx.gbl...
>I have fields that are listed as nvarchar in a table. Field1 contains the
>month, Field2 contains the day, Field3 contains the year.
> I need to pick stuff off this table with a "date" >= 12/10/2004.
> How do you construct the "date" from the 3 fields above?
> I've tried cast & converts on it, but have not hit the correct
> combination.
> Any help appreciated.
> BC
>|||concatenate and add '/' between the fields and convert the whole thing to a
datetime
http://sqlservercode.blogspot.com/
"Blasting Cap" wrote:
> I have fields that are listed as nvarchar in a table. Field1 contains
> the month, Field2 contains the day, Field3 contains the year.
> I need to pick stuff off this table with a "date" >= 12/10/2004.
> How do you construct the "date" from the 3 fields above?
> I've tried cast & converts on it, but have not hit the correct combination
.
> Any help appreciated.
> BC
>
Subscribe to:
Posts (Atom)