Showing posts with label assuming. Show all posts
Showing posts with label assuming. Show all posts

Sunday, March 25, 2012

Database size entry?

Which system table is the currently defined size (hopefully the total size)
of the data and log devices found?
I'm assuming in master somewhere? sysobjects? I just can't find it...
thanksDave,
Check out:
sysfiles
HTH
Jerry
"Dave H" <DaveH@.noemail.nospam> wrote in message
news:JpydnanWHeJCj6HeRVn-ug@.comcast.com...
> Which system table is the currently defined size (hopefully the total
> size)
> of the data and log devices found?
> I'm assuming in master somewhere? sysobjects? I just can't find it...
> thanks
>|||That's what I'm doing now.. is that how 'properties' figures the size?
lol: I totally looked past size there, and was just getting the file
names...
Thanks...
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:ODlqHFRxFHA.1256@.TK2MSFTNGP09.phx.gbl...
> Dave,
> Check out:
> sysfiles
> HTH
> Jerry
> "Dave H" <DaveH@.noemail.nospam> wrote in message
> news:JpydnanWHeJCj6HeRVn-ug@.comcast.com...
>|||Hi,
Its been taken from sysfiles table. You could just run a prfiler and get the
query. See the query I get for Master database property.
SELECT o.fileid, o.name, o.filename, o.groupid, o.size, o.maxsize, o.growth,
o.status FROM dbo.sysfiles o WHERE o.groupid = (SELECT u.groupid FROM
dbo.sysfilegroups u WHERE u.groupname = N'PRIMARY') and (o.status & 0x40) =
0
go
SELECT fileid, name, filename, size, growth, status, maxsize FROM
dbo.sysfiles WHERE (status & 0x40) <> 0
Thanks
Hari
SQL Server MVP
"Dave H" <DaveH@.noemail.nospam> wrote in message
news:ec-dnRXjTNF0iKHeRVn-rw@.comcast.com...
> That's what I'm doing now.. is that how 'properties' figures the size?
> lol: I totally looked past size there, and was just getting the file
> names...
> Thanks...
>
> "Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
> news:ODlqHFRxFHA.1256@.TK2MSFTNGP09.phx.gbl...
>

Sunday, February 19, 2012

Database Queries Using DATE

I am doing a database query in Java, and it seems to work fine using any of
the fields except for the date. I am assuming that this has something to do
with my syntax, since the DATE type has the most complicated syntax. My
query looks like the following:
SELECT * FROM Employee WHERE BDATE='4/20/1981'
BDATE is the field name, which is obviously of type DATE, and the error I
recieve is:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Dat
a type
mismatch in criteria expression.
I am assuming that when it says "Data type mismatch" it is interpreting
'4/20/1981' as a string. But because that is the format I used in the INSERT
statements when I added the records to the table. If this is the problem,
what should my query string? Thanks.
--
Nathan Sokalski
njsokalski@.hotmail.com> SELECT * FROM Employee WHERE BDATE='4/20/1981'
Ugh. Use a standard format. If you were looking for April 11th, Access or
your client app could easily misinterpret it as November 4th. If you use a
standard and unambiguous format, that won't happen.

> java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] D
ata type
> mismatch in criteria expression.
If you are querying Access, why are you posting to Java and SQL Server
groups? Learn how to use the tool you're using. Access requires dates to
be delimited by #, not ' ... try this, assuming your "date field" has no
time information:
SELECT * FROM Employee WHERE BDATE = '1981-04-20'
And BTW, don't use SELECT * in production code...
Followups set to microsoft.public.access.queries only.
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/