Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL syntax for displaying the total count of tables from a database

 
ruby shaw
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me the syntax for displaying the total count of the tables from any particular database using SQL server in VC++.
I used this "select count(*) as total from information_schema.columns where table_name =\'"
but it didnt work out.
-Thank You
 
Lilac Ezer
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the syntax for getting the number of user-defined tables in the database you are currently in:
select count(*) from sysobjects where type='U'
Hope that helps,
Lilac
 
sunita shaw
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi! lilac
thanx but this query runs only on SQL Server but i want a suery that will run in Ms Access 2000 for retrieving the names of tha tables of a database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic