Is it possible in db-lib to return the insertid of a record when its inserted, eg. insertid = dbsqlexec("Insert into .....etc") I know this can be done in mysql but dont know about ms sql, any info would be great. Shaun.