SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 QUERY that returns table specifics
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sinapra
Starting Member

India
24 Posts

Posted - 11/20/2006 :  09:16:36  Show Profile  Send sinapra an AOL message  Send sinapra a Yahoo! Message  Reply with Quote
Hello everyone

Can anyone help me by telling me whats the query that returns the column names, datatype, length and other properties without table data.

Thanks in Advance
Nagu

Cheers

harsh_athalye
Flowing Fount of Yak Knowledge

India
5581 Posts

Posted - 11/20/2006 :  09:22:54  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
sp_help 'tablename'


where tablename is the name of the table you want information for.

or

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tablename'


Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

sinapra
Starting Member

India
24 Posts

Posted - 11/20/2006 :  09:32:49  Show Profile  Send sinapra an AOL message  Send sinapra a Yahoo! Message  Reply with Quote
Thanks a lot Harsh, that really helps, but that didnot return the length of the datatype except Char type.

Cheers
Go to Top of Page

harsh_athalye
Flowing Fount of Yak Knowledge

India
5581 Posts

Posted - 11/20/2006 :  09:38:49  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
Have you checked the sp_help procedure?

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

sinapra
Starting Member

India
24 Posts

Posted - 11/20/2006 :  09:48:38  Show Profile  Send sinapra an AOL message  Send sinapra a Yahoo! Message  Reply with Quote
Harsh, I just did and got that as well, thanks again, but one more small one before I give a final touch

I tried this in Query Analyzer and extracted the info in CSV, but how to get it done in Enterprise manager, I mean running query is fine, but can it be saved thru enterprise manager.

Thanks again in advance
Prasad

Cheers
Go to Top of Page

harsh_athalye
Flowing Fount of Yak Knowledge

India
5581 Posts

Posted - 11/20/2006 :  10:08:19  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
I don't think so.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000