Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: get table and column names


Message #1 by Harish Babu.N <harish_babu@c...> on 1 Nov 2000 15:18:36 +0000
1.all the table names in the database:
	select name from sysobjects where type='U'
2.All the columns in  a table
	first step:
		know the id of table name:
		select id from sysobjects where name=tablename
	second step
		select name from syscolumns where id=table_id


-----Original Message-----
From: Harish Babu.N [mailto:harish_babu@c...]
Sent: Wednesday, November 01, 2000 11:19 PM
To: sql language
Subject: [sql_language] get table and column names


hi every body
 I want to write sql script to get
 1.All the table names in the database
 2.All the columns in  a table

Iam using Sql server.How do i do this?

Thanks in advance




  Return to Index