Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Describe Table?

Author  Topic 

Nitin Bansal
Starting Member

13 Posts

Posted - 2008-07-24 : 02:13:11
Hi, Is there any command so that i get whole Table Structure ?

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-07-24 : 02:14:42
you can generate the script for it through management studio / enterprise manager

Em
Go to Top of Page

Nitin Bansal
Starting Member

13 Posts

Posted - 2008-07-24 : 02:17:54
Sorry , I can't do that. I can not run enterprise manager , it is on server
which is beyond me.
Go to Top of Page

ratheeshknair
Posting Yak Master

129 Posts

Posted - 2008-07-24 : 02:35:47
How you connect to server???

RKNAIR
Go to Top of Page

Nitin Bansal
Starting Member

13 Posts

Posted - 2008-07-24 : 02:39:46
I have only the DSN name , i upload the file and retreving the data,
This time i need to know how many tables my database have and what the structure of it ?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-24 : 02:48:35
EXEC sp_help 'table_name'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Nitin Bansal
Starting Member

13 Posts

Posted - 2008-07-24 : 02:56:13
Thanks madhivanan, Thanku very much
Go to Top of Page

VGuyz
Posting Yak Master

121 Posts

Posted - 2008-07-24 : 08:29:55
By clicking the table_name
and then press Alt+F1
Go to Top of Page

Nitin Bansal
Starting Member

13 Posts

Posted - 2008-08-12 : 07:50:01
EXEC sp_help 'table_name'
Through This I get several things.
How can i get only Table Structure ?
B'cos i have to print it on my asp form, and it is very typical to print whole result.
Is there any way so that i can get only Table structure ?
{Second Result SET in Whole result}
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-12 : 07:54:59
quote:
Originally posted by Nitin Bansal

I have only the DSN name , i upload the file and retreving the data,
This time i need to know how many tables my database have and what the structure of it ?


Cant you use INFORMATION_SCHEMA views for this?
INFORMATION_SCHEMA.TABLES for table info and INFORMATION_SCHEMA.COLUMNS for column info
Go to Top of Page

Nitin Bansal
Starting Member

13 Posts

Posted - 2008-08-12 : 08:00:54
How can i use this INFORMATION_SCHEMA ?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-12 : 08:10:12
quote:
Originally posted by Nitin Bansal

How can i use this INFORMATION_SCHEMA ?



SELECT * FROM INFORMATION_SCHEMA.TABLES
will give you details of all tables in your db

and SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='YourTable'
will give you columns in the particular table
Go to Top of Page

Nitin Bansal
Starting Member

13 Posts

Posted - 2008-08-12 : 08:56:51
Thanks Mr. visakh murukes
Go to Top of Page
   

- Advertisement -