SQL details - improvements

Change-Id: Icd3dbb95160ba1874f07f7c58bcee8bec5242d33