Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Reply
SQL Server : return column names based on a record's value
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Vasanth Jack
7y
246
1
Reply
Hi,
I have one table.I want tha column names based on column values
|Field1 |Field2 |Field3 |Field4 |
|-------|-------|- ------ |-------|
| 1 | 0 | 0 |1 |
now i want the field name contain zero.Is this POssible in sql server.
What I have tried:
I've been trying to do various joins against sys.columns (and sys.tables), but so far to little avail.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Should sumarize totals's column with blank rows as null or 0
Differences between data reader and data table