Adding Server Prefix to string of field names

  • I am doing some dynamic programming and I have a list of field names that I am passing to a sql procedure from ms access. I want to add the table name as a prefix to the field names, how can i do this?

    string of field names is :

    'field1,field2,field3,field4,field5'

    I want to have:

    'MyTable.field1,MyTable.field2,MyTable.field3,MyTable.field4.MyTable.field5'

    Is there a function I can use to do this?

  • I found the answer to my own question:

    @MyTable + '.' + REPLACE(@MyFields,',',',' + @MyTable + '.')

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply