Sql Server Loop Through Table Variable