Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select * except one column 2

Status
Not open for further replies.
Joined
Jun 16, 2000
Messages
199
Location
US
Hi - I remember reading that there was an easy way to select everything (select *) with the exception of one column - I dont want to have to list out all the field names because I want all except one column.

Does anyone know how to do this - I cannot remember.

Thanks!

Angela
 
Go to QA, find table in object browser (F8), right-click, script as SELECT, remove unwanted column.

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
Select * is a very poor programming practice. Especially id you use it for anything with a join (sends repeated unnneeded information which can contribute to performance problems) or as part of the select in an insert statement (what happens if somebody changes the column order in one of the tables or addsa field to one but not the other?

Never select more fields than you need. Using select * saves nothing but a couple of seconds at most. YOu can drag all the field names over from the object browser in almost the same time it takes to use select *. Using selet * is just lazy.

Questions about posting. See faq183-874
Click here to help with Hurricane Relief
 
Thanks vongrunt for the information - this is not what I recall - I will have to look for what I was thinking about, but this did the job. Thanks!!!!!!!!

SQLSister - thanks for the information. In my case, I was appending to a specific table from backup where a customer messed up some records, so this was the simplist to do a select * to insert into an existing table that was in the same format.

So, while I agree with you that select * is usually not the best practice for joins and such - there are occasions where it is the best and quickest solution - as in my example...The reason I couldn't just use select * was because of an identity column that I needed to ignore and could not turn off in the live database.

Thanks everyone!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top