Questions tagged [rowcount]
405 questions
19
votes
5 answers
SET NOCOUNT OFF or RETURN @@ROWCOUNT?
I am creating a stored procedure in Sql Server 2008 database. I want to return the number of rows affected. Which is a better option SET NOCOUNT OFF or RETURN @@ROWCOUNT?
ALTER PROCEDURE [dbo].[MembersActivateAccount]
@MemberId…

niaher
- 9,460
- 7
- 67
- 86
16
votes
2 answers
SQL Alchemy ResultProxy.rowcount should not be zero
Does anyone know how to get the row count from an SQL Alchemy query ResultProxy object without looping through the result set? The ResultProxy.rowcount attribute shows 0, I would expect it to have a value of 2. For updates it shows the number of…

tponthieux
- 1,502
- 5
- 18
- 30
15
votes
5 answers
Flex - How to change open DropDownList height
Using FB4, I want to change the height of an open spark DropDownList. By default, it shows up to 6 items before scrolling. My dropdownlist contains 7 items, so I want to change the height of the open dropdown list to fit all 7 items without…

Travesty3
- 14,351
- 6
- 61
- 98
13
votes
8 answers
Move SQL Server data in limited (1000 row) chunks
I'm writing a process that archives rows from a SQL Server table based on a datetime column. I want to move all the rows with a date before X, but the problem is that there are millions of rows for each date, so doing a BEGIN…

SqlRyan
- 33,116
- 33
- 114
- 199
12
votes
3 answers
CTE, ROW_NUMBER and ROWCOUNT
I am trying to return a page of data and also row count of all data in one stored procedure which looks like following:
WITH Props AS
(
SELECT *,
ROW_NUMBER() OVER (ORDER BY PropertyID) AS RowNumber
FROM Property
WHERE PropertyType =…

David
- 830
- 3
- 13
- 25
12
votes
1 answer
mysql UNION result has less rows than sum of table row counts
I'm using UNION to get all names in different tables.
my tables has about 10000 rows all together.
but the query returns 468 rows!!
My query is:
SELECT name FROM `shopping`
UNION
SELECT name FROM stores
UNION
SELECT name FROM concert
UNION…

Ariyan
- 14,760
- 31
- 112
- 175
10
votes
3 answers
how to use rowcount in mysql using python
We are implementing a database in a student record project. We want to see that how many rows are there in a table before and after deleting a row from a table.
The code we tried is as follows:
1 roll=5
2 m =…

nishant
- 103
- 1
- 1
- 6
10
votes
7 answers
How to get row count of ObjectDataSource
Hello you all
How can i get row count of ObjectDataSouce ?
I use ObjectDataSource and DataList . I want show some thing to the user for example in a label when there are certain row returned by ObjectDataSource . One of situation is when there is…

Mostafa
- 3,002
- 10
- 52
- 79
9
votes
2 answers
How to find the total lines of csv files in a directory on Linux?
Working with huge CSV files for data analytics, we commonly need to know the row count of all csv files located in a particular folder.
But how to do it with just only one command in Linux?

Cesar Augusto Nogueira
- 1,911
- 1
- 14
- 14
8
votes
3 answers
Show Row Count in SQL Profiler
Is it possible to show a "Row Count" column in SQL Server Profiler?
For example there are CPU and Duration columns but can it show how many rows a query returns?

Kobus Smit
- 1,775
- 2
- 18
- 30
7
votes
4 answers
Is it safe to use SET ROWCOUNT?
I am using SET ROWCOUNT because the value comes from a parameter into my procedure.
SET ROWCOUNT @take
SELECT * FROM Something
SET ROWCOUNT 0
Is it possible to another procedure executes at the same time and get the rowcount setting, or is it…

BrunoLM
- 97,872
- 84
- 296
- 452
7
votes
2 answers
Unexpected @@rowcount behavior inside an UDF in MS SQL 2019
here's my sample code
drop function rowcount_test
go
CREATE FUNCTION dbo.rowcount_test () RETURNS INT AS
BEGIN
DECLARE @v INT
SELECT @v = 1
return @@ROWCOUNT
END
GO
grant exec on dbo.rowcount_test to public
go
SELECT…

pelod
- 73
- 1
- 5
7
votes
1 answer
Python Pandas count rows based on column
How to get row counts based on one column in Python pandas.
For example I have a data frame like this:
Name NameTitle Sex
John Dr m
Mona Dr f
Mary Mrs f
Tom Mr …

raja
- 380
- 2
- 9
- 20
7
votes
3 answers
Why can't I get the @@rowcount value?
Below is a simplified version of SQL script I have. print @RowNum always shows 0, rather than the real record number of the first result set. What's wrong? Thank you.
declare @i int, @RowNum int
set @i=0
while @i<2
begin
execute StoredProcedure…

phoenies
- 537
- 2
- 5
- 16
6
votes
1 answer
Is there a PostgreSQL equivalent of SELECT @@ROWCOUNT in T-SQL?
Question says it all. Any help with working sample much appreciated.
Thanks.

Fung
- 7,530
- 7
- 53
- 68