Latest 100 public
snipts » count
showing 1-9 of 9 snipts for count
-
∞ Count tables, views, stored procedures and functions in Database
--- /* Count Number Of Tables In A Database */ SELECT COUNT(*) AS TABLE_COUNT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' --- /* Count Number Of Views In A Database */ SELECT COUNT(*) AS VIEW_COUNT FROM INFORMATION_SCHEMA.VIEWS --- /* Count Number Of Stored Procedures In A Database */ SELECT COUNT(*) AS PROCEDURE_COUNT FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'PROCEDURE' --- /* Count Number Of Functions In A Database */ SELECT COUNT(*) AS FUNCTION_COUNT FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'FUNCTION'
-
∞ Count number of tables in a SQL Server database
USE YOURDBNAME SELECT COUNT(*) from information_schema.tables WHERE table_type = 'base table'
-
∞ Returns the number of results
<?php echo $wp_query->found_posts; ?>
-
∞ Count Monthly/Yearly Totals in MySQL
SELECT MONTHNAME(createDt) AS month, YEAR(createDt) AS year, COUNT(*) AS total FROM tracking GROUP BY MONTH(createDt), YEAR(createDt) ORDER BY id
-
∞ count how many pdf or chm files are there in endnote
ls -R -l /Users/sixinghuang/Documents/My\ EndNote\ Library.Data | egrep "\.pdf|\.chm" | wc -l
-
∞ Count Files and Folders
ls -l | wc -l
-
∞ Méthode pour compter les résultats depuis un SELECT utilisant une clause LIMIT
SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name WHERE id > 100 LIMIT 10; SELECT FOUND_ROWS();
-
∞ Table sizes
DECLARE @TableName VARCHAR(100) --For storing values in the cursor --Cursor to get the name of all user tables from the sysobjects listing DECLARE tableCursor CURSOR FOR select [name] from dbo.sysobjects where OBJECTPROPERTY(id, N'IsUserTable') = 1 FOR READ ONLY --A procedure level temp table to store the results CREATE TABLE #TempTable ( tableName varchar(100), numberofRows int, reservedSize varchar(50), dataSize varchar(50), indexSize varchar(50), unusedSize varchar(50) ) --Open the cursor OPEN tableCursor --Get the first table name from the cursor FETCH NEXT FROM tableCursor INTO @TableName --Loop until the cursor was not able to fetch WHILE (@@Fetch_Status >= 0) BEGIN --Dump the results of the sp_spaceused query to the temp table INSERT #TempTable EXEC sp_spaceused @TableName --Get the next table name FETCH NEXT FROM tableCursor INTO @TableName END --Get rid of the cursor CLOSE tableCursor DEALLOCATE tableCursor --Select all records so we can use the reults SELECT * FROM #TempTable order by numberofRows desc --Final cleanup! DROP TABLE #TempTable
-
∞ Table row count
SELECT [TableName] = so.name, --[RowCount] = MAX(si.rows) * FROM sysobjects so, sysindexes si WHERE so.xtype = 'U' AND si.id = OBJECT_ID(so.name) --GROUP BY -- so.name ORDER BY 2 DESC


