Creating ChainName SQLQuery