mssql doesnt have length function, using simpler select