Thank you a lot, DBomrrsm. Now it seems to be working, just taking really long time... Please, explain to me what the following means:
'SELECT ''' + @TableName + '.' + @ColumnName + ''', LEFT(' + @ColumnName + ', 3630)
What is the bunch of '''' means?
Thanks.