rowcount

Aggregate analog of row count component?

I'd like to have a way to get the sum of a field stored into a variable from inside a dataflow task. The rowcount transform does this, but I can't see how to use any other aggregate functions. Is scripting a transform component my best bet? ...

What is a good way to assign order #s to ordered rows in a table in Sybase

I have a table T (structure below) which initially contains all-NULL values in an integer order column: col1 varchar(30), col2 varchar(30), order int NULL I also have a way to order the "colN" columns, e.g. SELECT * FROM T ORDER BY some_expression_involving_col1_and_col2 What's the best way to assign - IN SQL - numeric order val...

Get the row count of a select... group by mysql statement

I have a table of products which contains some 2000 clothing products, each product has a grpIdent field and a productGroup field. when I run the following query: select count(1) from tblclothingitems ci where productGroup='hel' group by productGroup, grpIdent I get a resultset of 99 rows, according to SQL Yog, containing differen...

How to get rows count of rowset in OLE DB

How is possible to get rows count of rowset in OLE DB? I have filled RowSet using CCommand and CAccessor and now I dont know how to get rows count. I can go through all rows using MoveNext() but it does not seem efective. Thanks ...

How to check if anything was inserted with INSERT SELECT (T-SQL)

I have an insert statement: insert into parentTbl select firstId, secondId, thirdId, dateTm from importTbl where codeId = @codeIdParam I need to reliably find out if that insert inserted anything at all. Ideally, I would like to set a @insertedCount variable to the number of rows inserted, even if that is 0. I am currently using: s...

sql direct way to get number of rows in table

Hi again people of stackoverflow. I have a routine that has a step that I find unnecessary lets say you want to get all the images from a gallery, and limit a certain number of images per page. $db = PDO object $start = (pagenum x images per page) $limit = (images per page) $itemsdata = $db->query("SELECT id,name FROM gallery LIMIT $sta...

How do I count the number of rows in a table using the .NET Framework Data Provider for mySAP Business Suite

SELECT count(*) FROM myTable does not seem to work when connected to an SAP-database with the ADO.NET Data Provider for mySAP Business Suite. Any ideas on how I can count the number of rows that a table contains without actually returning all the rows? Therese is a reference for the SELECT statement here, but it didn't help much: http:/...

Limiting rowcount of SELECT statements, with linked servers

I have these linked servers, A and B. Server A is running SQL Server 2008, and B is running SQL Server 2000. I have written a script to migrate data from a bunch of tables from B to A. The data is quite sensitive so I'm afraid I can't tell you anymore about that. I can, however, tell you that we are talking about a lot of data, worst ca...

[SQL] 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 @i --containing a big select if @i=0 set @RowNum=@@rowcount set @i=@i+1 end print...

Send the total rows/last row, included with the resultset

I have this procedure used for getting items on the current page. I would also like the include an OUT var having the total number of items so I can calculate the total number of pages. USE [some_name] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[GetFilteredProductDetails] @start int, @end int AS B...