Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

SQL Server 2008 error trying to return number of table in a DB

See attachment of error and select statement when trying to return a count of number of tables in a database.
SQLErr.JPG
0
bjbrown
Asked:
bjbrown
1 Solution
 
burditCommented:
Why are you debugging it? Just hit F5 (execute).
0
 
PadawanDBAOperational DBACommented:
If you're looking for the number of tables in a database, why don't you just use:

use <database_to_count>
go;

select
    count( 1 ) as tableCount
from
    sys.tables;

Open in new window

0
 
bjbrownAuthor Commented:
Thanks for the quick response and accurate solution.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now