Our object is to save infopath form in the SQL server. For this:
1. Create store proc which accepts parameters for saving (Inserting and updating) data and return ID (Primary Key)field value.
2. Create webservice which accept parameters in the form of string and datetime only and convert it into appropriate form(like string to int/Boolean/decimal whatever type of parameters in stored proc) with validation and pass into stored proc to save data. If id= -1 then insert else update process will happen.
3. Create infopath form using this webservice. (click here to see how to create webservice based infopath form)
4. Design form and Drag Primary ID field, set its default value = -1 for insertion and set its width = 1px to prevent from user interaction. As in stored proc If id= -1 then insertion takes place else updating.
5. If you want to submit it in MOSS, see here and publish it.