dbTalk Databases Forums  

printing table structure

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss printing table structure in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
J Harrigan
 
Posts: n/a

Default printing table structure - 01-22-2004 , 09:30 AM






How do you print the fieldnames and datatypes in a
table? I know there's a way because I've done it...but can't remember and
don't see an option in the menu choices...thanks...Jan



Reply With Quote
  #2  
Old   
Hari
 
Posts: n/a

Default Re: printing table structure - 01-22-2004 , 10:19 AM






Hi,
Did you mean just display, then

select table_name,data_type,character_maximum_length from
information_schema.columns
where table_name='tablename'

otherwise

sp_columns tablename

Thanks
Hari
MCDBA

"J Harrigan" <jlharrigan (AT) hotmail (DOT) com> wrote

Quote:
How do you print the fieldnames and datatypes in a
table? I know there's a way because I've done it...but can't remember and
don't see an option in the menu choices...thanks...Jan





Reply With Quote
  #3  
Old   
Scuba79
 
Posts: n/a

Default RE: printing table structure - 01-22-2004 , 10:31 AM



try
EXEC sp_columns @table_name = 'name of table

----- J Harrigan wrote: ----

How do you print the fieldnames and datatypes in
table? I know there's a way because I've done it...but can't remember an
don't see an option in the menu choices...thanks...Ja




Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: printing table structure - 01-22-2004 , 10:42 AM



You asked this yesterday I believe

I gave you a number of ways then but the way I believe you want is

Right click on the object | All Tasks | Generate SQL Script

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"J Harrigan" <jlharrigan (AT) hotmail (DOT) com> wrote

Quote:
How do you print the fieldnames and datatypes in a
table? I know there's a way because I've done it...but can't remember and
don't see an option in the menu choices...thanks...Jan





Reply With Quote
  #5  
Old   
J Harrigan
 
Posts: n/a

Default Re: printing table structure - 01-22-2004 , 11:45 AM



Yes...your response wasn't there when I looked this morning but it IS there
now...THANKS again!

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
You asked this yesterday I believe

I gave you a number of ways then but the way I believe you want is

Right click on the object | All Tasks | Generate SQL Script

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"J Harrigan" <jlharrigan (AT) hotmail (DOT) com> wrote in message
news:%23Og6gyP4DHA.1936 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
How do you print the fieldnames and datatypes in a
table? I know there's a way because I've done it...but can't remember
and
don't see an option in the menu choices...thanks...Jan







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.