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 - 2005-10-25 : 07:55:44
|
| santosh writes "In a sql trigger,I have a statement ...select * from insertedassuming that i don't know the column names,how to iterate through each column of rowlike...foreach column of inserted row, get column nameTHANKS." |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-10-25 : 08:08:18
|
how do you don't know the column names??you have to.there is no way to iterate through column names....you can get all of the column names from information_schema.columns view though.select column_name from information_schema.columns where table_name = 'yourTableName'Go with the flow & have fun! Else fight the flow |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2005-10-25 : 10:01:57
|
| The trigger is specific to a table. How can you not know the column names of the table? And why do you think you need to iterate through the column names anyway? I smell a conceptual issue here...why don't you tell us why you think you need to do this? |
 |
|
|
|
|
|