Posts tagged Record Count
Table information – column lengths, counts and unique counts
12 months ago
in Transact-SQL
Hi.
The Transact-SQL script below returns the following information:
ID – Just an identity column used within the script
SchemaName – The name of the schema
TableName – Obviously, the name of the table
ColumnName
Type – The data type of the column
Length – The maximum number of bytes used by the [...]
Count the number of records in each table within a database
01 year ago
in Transact-SQL
The Transact-SQL script below (written for SQL Server 2000, but also works with 2005), returns a list of tables and a count of the number of records within each table.
USE [database name]
GO
DECLARE @name VARCHAR(500)
DECLARE @sql VARCHAR(1000)
CREATE TABLE #TableRecordCount
( TableName [...]
List of database tables, with count of records.
03 years ago
in General
Use the script below, to return a list of database tables (the schema and table name) along with a count of the records within each table. This can come in useful if you are trying to compare databases.
DECLARE @TableName VARCHAR(100)
DECLARE @Schema VARCHAR(100)
DECLARE @SQL VARCHAR(1000)
DECLARE [...]