clean sql, merge user and tcs