Questions tagged [rowcount]
405 questions
434
votes
24 answers
Get record counts for all tables in MySQL database
Is there a way to get the count of rows in all tables in a MySQL database without running a SELECT count() on each table?

Mark
- 4,719
- 4
- 18
- 11
305
votes
13 answers
How to fetch the row count for all tables in a SQL SERVER database
I am searching for a SQL Script that can be used to determine if there is any data (i.e. row count) in any of the tables of a given database.
The idea is to re-incarnate the database in case there are any rows existing (in any of the database).
The…

vijaysylvester
- 4,750
- 7
- 29
- 41
237
votes
7 answers
Fast way to discover the row count of a table in PostgreSQL
I need to know the number of rows in a table to calculate a percentage. If the total count is greater than some predefined constant, I will use the constant value. Otherwise, I will use the actual number of rows.
I can use SELECT count(*) FROM…

Renato Dinhani
- 35,057
- 55
- 139
- 199
70
votes
6 answers
How to get the number of deleted rows in PostgreSQL?
I am looking for a way to return the number of rows affected by a DELETE clause in PostgreSQL. The documentation states that;
On successful completion, a DELETE
command returns a command tag of the
form
DELETE count
The count is the number of…

Erkan Haspulat
- 12,032
- 6
- 39
- 45
64
votes
8 answers
count number of rows in a data frame in R based on group
I have a data frame in R like this:
ID MONTH-YEAR VALUE
110 JAN. 2012 1000
111 JAN. 2012 2000
. .
. .
121 FEB. 2012 3000
131 FEB. 2012 4000
. .
. …

Jason Donnald
- 2,256
- 9
- 36
- 49
48
votes
6 answers
Row count of a column family in Cassandra
Is there a way to get a row count (key count) of a single column family in Cassandra? get_count can only be used to get the column count.
For instance, if I have a column family containing users and wanted to get the number of users. How could I do…

Henri Liljeroos
- 511
- 1
- 4
- 4
47
votes
15 answers
How to show all rows in the jqGrid?
jqGrid exposes a property rowNum where you can set the number of rows to display for each page. How do you set the grid to just display ALL rows?
Right now I'm just setting the rowNum to something really high like <%= int.MaxValue %> but I'm…

Jon Erickson
- 112,242
- 44
- 136
- 174
39
votes
7 answers
Return number of rows affected by SQL UPDATE statement in Java
I'm using a MySQL database and accessing it through Java.
PreparedStatement prep1 = this.connection.prepareStatement(
"UPDATE user_table
SET Level = 'Super'
WHERE Username = ?");
prep1.setString(1, username);
The update…

Krt_Malta
- 9,265
- 18
- 53
- 91
35
votes
3 answers
Sql Server 2008 MERGE - best way to get counts
I'm wondering what y'alls would recommend as the best way to go about getting the action counts from a MERGE statement in Sql Server.
So, i.e. I run a MERGE which does some inserts, some updates and some deletes, ... I would like to be able to find…

eidylon
- 7,068
- 20
- 75
- 118
31
votes
2 answers
Scope of @@rowcount?
What is the scope of @@rowcount ?MSDN doesn't mention its scope.
Returns the number of rows affected by the last statement.
Ok.
In my SP — I'm inserting into a table , which has a insert trigger which does another insertion when a new value is…

Royi Namir
- 144,742
- 138
- 468
- 792
30
votes
4 answers
How do I get row count using the NHibernate QueryOver api?
I'm using the QueryOver api that is part of NHibernate 3.x. I would like to get a row count, but the method I'm using returns all objects and then gets the count of the collection. Is there a way to just return an integer/long value of the number…

Jim Geurts
- 20,189
- 23
- 95
- 116
24
votes
5 answers
Count total number of lines in an Xcode project
What is the way to count total number of lines in an Xcode Project? I can see number of lines in an individual file but I need a sum up of all the lines in a project.
user3892683
24
votes
7 answers
SQL Server batch delete using WHILE loop does not work
I have a very large table, so I am using the following to delete older entries:
WHILE (@@ROWCOUNT > 0)
BEGIN
DELETE TOP (5000) FROM myTable
WHERE date < 20130103
END
I have run this a few times using different dates. Sometimes it works…

JCB
- 1,797
- 5
- 18
- 22
20
votes
1 answer
SQL Server - does trigger affects @@Rowcount?
I have a query which do UPSERT or update if exists and insert if not:
update MyTable
set [Name]=@NewValue
where ID=@ID
If @@RowCount = 0
insert into MyTable([Name])
values(@Name)
Now, I wonder if the @@RowCount will be affected by a query…

kazinix
- 28,987
- 33
- 107
- 157
20
votes
6 answers
Count rows within partition in Azure table storage
I've seen various questions around SO about how to get the total row count of an Azure storage table, but I want to know how to get the number of rows within a single partition.
How can I do this while loading a minimal amount of entity data into…

goelze
- 488
- 1
- 3
- 14