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 |
|
Crowson
Starting Member
2 Posts |
Posted - 2008-06-23 : 14:38:38
|
| I have a really large table with many Proposal fields and corresponding approval fields.Propose1Approve1Propose2Approve2Would it be good practice or even possible for me to select all proposal fields using a wildcard somehow within the select statement. If it is ok, how would I go about doing it? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-06-23 : 14:40:05
|
| You could use * to return all columns, but that's a bad practice. You can't use * to return a subset of columns.Why have you designed a table like this? Are you familiar with database normalization?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-06-23 : 14:43:14
|
| I would right-click on the table in Management Studio and then select Script as --> Select To and then get rid of the columns youdon't need.Jim |
 |
|
|
Crowson
Starting Member
2 Posts |
Posted - 2008-06-23 : 14:46:22
|
| No, this is not normalized to the third form, but I can't think of how it would happen.I'm attempting to take a paper form and use it within a small database system. There are many steps, each step having a proposed completion date and an actual completion date. Both of these dates are separate fields within the form. There are also other fields that will be used that refer to other information.If you can think of how to set this up in multiple tables please let me know. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-06-23 : 16:09:55
|
| Or make use of the resultSelect column_name+',' from information_schema.tableswhere table_name='your table'MadhivananFailing to plan is Planning to fail |
 |
|
|
rohitkumar
Constraint Violating Yak Guru
472 Posts |
Posted - 2008-06-23 : 16:31:22
|
| you cannot use a wild card to get selective columns.you can have another table with form_id, step_id, proposed_start_date, actual_start_date, user_id |
 |
|
|
|
|
|