Saturday, September 7, 2013

How to find names of tables from a database in SQL Server


Showing Table names from a Database in SQl Server

In SQL Server "sts.Tables" is gives all the information about the tables which are present in a database.
here is the example for this

Ex:
use database_name
 select *  from sys.tables

This query results all the information about the table such as name, creation date,modified date,type etc..
Now you can select which column you want from that table..

Ex:
use database_name
select name from sys.tables

---------------------------------------------------------------------------------------------------------
How to know how many tables are there in a Database 

From the above we know about sys.tables.
now we count how many tables are present a Database.
see this example.

Ex:
use Database_name
Select count(*) form sys.tables

this query results number of tables present in a Database.

No comments:

Post a Comment

amazon

Sukanya Samriddhi Account - SBI

SUKANYA SAMRIDDHI Account information by SBI SUKANYA SAMRIDDHI ACCOUNT : FACILITY AVAILABLE AT ALL BRANCHES OF SBI Sukanya Samriddhi ...