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 |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-09-19 : 07:41:20
|
Hari writes "Sub:- looking for Field name from table on select criteriadear friends I have an table [assosories] which have 100 fields. initial 10 fields have some date, varchar, int types rest 90 are bool type. for a single row I need to know the field name which have true vaules in rest 90 fields I need to insert this field name into another table as a row.Thanks HARI" |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-19 : 08:06:46
|
Should ALL other 90 fields be TRUE? Or is ANY other 90 fields set to TRUE?Peter LarssonHelsingborg, Sweden |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-09-19 : 08:10:08
|
Is this what you want?Select SomeColFrom TblWhere BoolCol1 = 1and BoolCol2 = 1and BoolCol3 = 1... If you want to avoid typing column names, query them from Information_Schema.Columns.Harsh AthalyeIndia."Nothing is Impossible" |
|
|
|
|
|