[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.sqlserver.programming

SELECT * FROM tbl1 except col1

Hitesh Joshi

3/20/2007 2:00:00 PM


Hi,

If I have a tbl1 with col1, col2, col3, col4

Is there a way I can do a simple SELECT * FROM tbl1 and I could
exclude col1?

Thanks,
hj

5 Answers

jeevan

3/20/2007 2:04:00 PM

0


"Hitesh" <hitesh287@gmail.com> wrote in message
news:1174399229.180020.128080@b75g2000hsg.googlegroups.com...
>
> Hi,
>
> If I have a tbl1 with col1, col2, col3, col4
>
> Is there a way I can do a simple SELECT * FROM tbl1 and I could
> exclude col1?

SELECT col2, col3, col4
FROM tbl1


cb meeks

3/20/2007 2:09:00 PM

0

Is there any reason why you can't

SELECT col2,col3,col4 FROM tbl1

??
------------------------------------
Need file/mirror hosting?
http://www.sig...



On Mar 20, 10:00 am, "Hitesh" <hitesh...@gmail.com> wrote:
> Hi,
>
> If I have a tbl1 with col1, col2, col3, col4
>
> Is there a way I can do a simple SELECT * FROM tbl1 and I could
> exclude col1?
>
> Thanks,
> hj


Alejandro Mesa

3/20/2007 2:11:00 PM

0

Hitesh,

No, but you can drag and drop folder "Columns" from the "object explorer"
window (SSMS) into the query window and then delete the column you want to
exclude, when creating the "select" statement.


AMB

"Hitesh" wrote:

>
> Hi,
>
> If I have a tbl1 with col1, col2, col3, col4
>
> Is there a way I can do a simple SELECT * FROM tbl1 and I could
> exclude col1?
>
> Thanks,
> hj
>
>

Hitesh Joshi

3/20/2007 3:25:00 PM

0

On Mar 20, 10:00 am, "Hitesh" <hitesh...@gmail.com> wrote:
> Hi,
>
> If I have a tbl1 with col1, col2, col3, col4
>
> Is there a way I can do a simple SELECT * FROM tbl1 and I could
> exclude col1?
>
> Thanks,
> hj

If i have let's say 15 to 20 columns and if I want to omit two or
three columns,
I thought it would be lot easier if I could do something like..

SELECT * FROM tbl1 exclude col1

but anyway I could type..

SELECT col2, col3, col4 FRM tbl1.

Thank you everyone..

hj

Steve Dassin

3/21/2007 12:29:00 AM

0

"Hitesh" <hitesh287@gmail.com> wrote in message
news:1174404311.867145.44880@b75g2000hsg.googlegroups.com...
> I thought it would be lot easier if I could do something like..
> SELECT * FROM tbl1 exclude col1

You have the weight of common sense on your side.
But it is a weight that sql cannot support. Such is the nature of
lite-weights.

www.beyondsql.blogspot.com