Home All Groups Group Topic Archive Search About

Loop through table using column id instead of name

Author
1 Sep 2005 9:47 PM
Ken Holzer
I need to generate a comma delimited file that is a copy of a row in a table.
I would like to be able to use the column id instead of the column name to do
this. i would like to be able to pass a table name to the stored procedure
and not have to have the column names hard coded.

Is this even possible?

I know it is possible to do in C++ or VB, but can it be done as a stored
procedure.

Thanks for your help,

Ken

Author
1 Sep 2005 10:52 PM
Trey Walpole
It seems to me it's much more efficient to do it in the calling application.
String and file handling isn't T-SQL's strong suit.

Ken Holzer wrote:
Show quote
> I need to generate a comma delimited file that is a copy of a row in a table.
> I would like to be able to use the column id instead of the column name to do
> this. i would like to be able to pass a table name to the stored procedure
> and not have to have the column names hard coded.
>
> Is this even possible?
>
> I know it is possible to do in C++ or VB, but can it be done as a stored
> procedure.
>
> Thanks for your help,
>
> Ken

AddThis Social Bookmark Button