Re: Records in a database
From: Dan Guzman (guzmanda_at_nospam-online.sbcglobal.net)
Date: 12/04/04
- Next message: Andrew J. Kelly: "Re: sort order in query changes on one SQL Server but not another"
- Previous message: John A Grandy: "change collation name after creating database ?"
- In reply to: robert_at_cbb: "Re: Records in a database"
- Next in thread: David Gugick: "Re: Records in a database"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 3 Dec 2004 21:17:26 -0600
Expanding on Wayne's response, you can get an estimated rowcount from
sysindexes using the query below. You can execute sp_spaceused
@updateusage=true beforehand to improve accuracy.
SELECT SUM(rows)
FROM sysindexes
WHERE
indid IN(0, 1) AND
OBJECTPROPERTY(id, 'IsMSShipped') = 0
-- Hope this helps. Dan Guzman SQL Server MVP "robert_at_cbb" <robertatcbb@discussions.microsoft.com> wrote in message news:55495ECE-2FC4-4C9C-BDBA-EE76A73E6639@microsoft.com... > Thanks guys, how would I colloct the record count of the database. > > "Wayne Snyder" wrote: > >> For a quick (estimated ) rowcount, sp_spaceused tablename,,, This data is >> stored in Sysindexes, in case you wish to write your own query. >> >> -- >> Wayne Snyder, MCDBA, SQL Server MVP >> Mariner, Charlotte, NC >> www.mariner-usa.com >> (Please respond only to the newsgroups.) >> >> I support the Professional Association of SQL Server (PASS) and it's >> community of SQL Server professionals. >> www.sqlpass.org >> >> "robert_at_cbb" <robertatcbb@discussions.microsoft.com> wrote in message >> news:5DA210D7-62ED-4209-A7AB-8A3D828B228F@microsoft.com... >> > I need some help. How can I find how many records are in a data base. >> >> >>
- Next message: Andrew J. Kelly: "Re: sort order in query changes on one SQL Server but not another"
- Previous message: John A Grandy: "change collation name after creating database ?"
- In reply to: robert_at_cbb: "Re: Records in a database"
- Next in thread: David Gugick: "Re: Records in a database"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading