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.
Author |
Topic |
mind_grapes
Yak Posting Veteran
71 Posts |
Posted - 2009-08-25 : 07:08:18
|
Hi all quick quesiton. Is this the most effiecient way to do this? I want to display all columns in MS SQL:select syscolumns.name as [Column], syscolumns.xusertype as [Type], sysobjects.xtype as [Objtype]from sysobjects, syscolumns where sysobjects.id = syscolumns.idand sysobjects.xtype = 'u'and sysobjects.name = 'tblAssociation'order by syscolumns.name |
|
raky
Aged Yak Warrior
767 Posts |
Posted - 2009-08-25 : 07:10:59
|
select * from information_schema.columns where table_name = 'x' |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-08-25 : 07:12:18
|
select * from information_schema.columns where table_name = 'tblAssociation' |
|
|
rajdaksha
Aged Yak Warrior
595 Posts |
Posted - 2009-08-25 : 07:13:56
|
[code]SELECT sysobjects.name AS table_name , syscolumns.name AS column_name, systypes.name AS datatype , syscolumns.LENGTH AS LENGTHFROM sysobjects INNER JOIN syscolumns ON sysobjects.id = syscolumns.id INNER JOIN systypes ON syscolumns.xtype = systypes.xtypeWHERE ( sysobjects.xtype = 'U' )ORDER BY sysobjects.name, syscolumns.colid[/code]-------------------------R... |
|
|
mind_grapes
Yak Posting Veteran
71 Posts |
Posted - 2009-08-25 : 07:18:45
|
Thanks guys, has worked.RegardsMG |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-08-25 : 07:19:56
|
welcome |
|
|
|
|
|