About 50 results
Open links in new tab
  1. sql server - SQL count rows in a table - Stack Overflow

    Mar 7, 2015 · I need to send a SQL query to a database that tells me how many rows there are in a table. I could get all the rows in the table with a SELECT and then count them, but I don't like to do it …

  2. sql - Fastest way to count exact number of rows in a very large table ...

    May 20, 2011 · In SQL server 2016, I can just check table properties and then select 'Storage' tab - this gives me row count, disk space used by the table, index space used etc.

  3. sql - How do I use ROW_NUMBER ()? - Stack Overflow

    Jun 7, 2009 · SQL Row_Number () function is to sort and assign an order number to data rows in related record set. So it is used to number rows, for example to identify the top 10 rows which have the …

  4. SQL Row_Count function with Partition - Stack Overflow

    ROW_NUMBER() Over(partition by Data.WorksOrderNo order by Data.WorksOrderNo) as RowNo, Is there an equivalent ROW_Count function where I can specify a partition, and return the count of …

  5. odbc - Need a row count after SELECT statement: what's the optimal …

    If you're using SQL Server, after your query you can select the @@RowCount function (or if your result set might have more than 2 billion rows use the RowCount_Big () function). This will return the …

  6. sql - Selecting COUNT (*) with DISTINCT - Stack Overflow

    Count(DISTINCT program_name) AS [Count], FROM cm_production WHERE push_number = @push_number GROUP BY program_type DISTINCT COUNT(*) will return a row for each unique …

  7. Script that provides the row counts and table names

    Maybe you easily said how to I provide table names and row counts? Pseudo SQL: for "select tablename from system.Tables" into :tablename execute "select count(*) from ? into ?" using …

  8. Is it possible to specify condition in Count ()? - Stack Overflow

    Feb 16, 2018 · Is it possible to specify a condition in Count()? I would like to count only the rows that have, for example, "Manager" in the Position column. I want to do it in the count statement, not using …

  9. sql - How to use @@ROWCOUNT in IF statement as well as within …

    Apr 30, 2012 · SET @var = (SELECT var FROM dbo.varDB WHERE varName = @varName) IF (@@ROWCOUNT > 0) BEGIN //carry out insert END Am I right in saying this will always return a 1 …

  10. sql - Set count to variable - Stack Overflow

    Sep 22, 2021 · 10 @ROW_COUNT should be integer. You don't need to use CAST() if you defined it as integer. You need to assign @ROW_COUNT to COUNT(*). use QUOTENAME() on the …