Click here to Skip to main content
15,879,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
what is the query that is used to count the number of rows of a table in a data base
Posted
Updated 27-Oct-12 8:35am
v3
Comments
jackfrnz 27-Oct-12 14:31pm    
what do you mean by "base table data" ?

count the number of rows of a table
SQL
SELECT COUNT(*) FROM myTable

Refer: MSDN: COUNT (Transact-SQL)[^]
 
Share this answer
 
Comments
Mounayangui 27-Oct-12 14:55pm    
i want to affect the number of the row in an integer variable
Sandeep Mewara 27-Oct-12 14:59pm    
1. You comment is 'Not clear'.
2. Your question just asks for a query to find count.
adriancs 27-Oct-12 21:47pm    
Yes, this query will return an integer.
adriancs 27-Oct-12 21:46pm    
shot at target. vote 5
SELECT COUNT(*) into nbr FROM myTable
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900