• You need to add exec(@sql). The listed code only prints the statement.