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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 extracting all columns without using star(*)

Author  Topic 

rajkumarrai_bis
Yak Posting Veteran

78 Posts

Posted - 2007-01-24 : 21:05:24
this is kind'a tricky
can we extract all columns without using star(*)
thanks in advance

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-01-24 : 21:15:05
yes. Just type in the column name one by one.


KH

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-01-24 : 21:19:24
or using SSMS, navigate to table, click on the 'columns' and drag the columns to the query window.


KH

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-25 : 00:57:32
sp_help <YourTableNameHere>

And of course a copy&paste operation


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-01-25 : 01:32:28
or

sp_columns <YourTableNameHere>

And of course a copy & paste operation


KH

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-01-25 : 04:01:59
Or write your own SProc that delivers the Column Names in a variety of useful formats (which is what we have done) ...

And of course a copy & paste operation

Kristen
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-01-25 : 04:06:19
Kristen, something wrong with you copy & paste. There is an extra there


KH

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-01-25 : 04:25:28
I was using my smiley-escallation-algorithm. , , ...
Go to Top of Page

rajkumarrai_bis
Yak Posting Veteran

78 Posts

Posted - 2007-01-25 : 20:20:59
Hi Guys,
Funny..But not at the moment
I m seriuos abt this
Plz Help..
Thanks in advance
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-01-25 : 20:25:13
Didn't we have given you the alternative ?


KH

Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-01-25 : 20:49:11
quote:
Originally posted by rajkumarrai_bis

Hi Guys,
Funny..But not at the moment
I m seriuos abt this
Plz Help..
Thanks in advance



Please explain what you are looking for.

Is it just too much trouble to type in "SELECT * FROM MY_TABLE"?




CODO ERGO SUM
Go to Top of Page
   

- Advertisement -