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
1
Answer
how can I fetch column name and its data using query?
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Fareeda Hussain
7y
206
1
Reply
Hi
Can I retrieve the column name and its particular data as two column values .Its possible to fetch column name from INFORMATION_SCHEMA.COLUMNS.Can we get
the data also with the same query like
set @tsql = 'select '+@col +' = Column_name,(select @col from @tablename)
from INFORMATION_SCHEMA.COLUMNS
where Table_name like '''+@tablename+'''
exec(@tsql);
.Or can we put for loop inside the stored procedure
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
write trigger after insert to send mail to employeee
Get unique data among multiple items