execute result of select statement
问题 How can I execute the results of my select query. The query below gives me some SQL statements back as result. I want to execute does statements, how to do this? All this is executed in SQL Sever Management Studio. Query: SELECT 'UPDATE Rolecopy SET PartofFT = ''' + R2.PlayedbyOT + ''', OriginalOT = ''' + R.PlayedbyOT + ''' WHERE RoleNo = ' + CAST(R.RoleNo AS VARCHAR) + CHAR(13) FROM Role R INNER JOIN Role R2 ON R.PartofFT = R2.PartofFT AND R.RoleNo <> R2.RoleNo WHERE EXISTS ( SELECT PG