Updated split function in sql