Xavier,
I have had to use a stored proceedure recently and found Hilary Stoupa's post on "Fun with Sequential Form IDs, SQL and Sprocs!" a real hair saver.
http://www.infopathdev.com/blogs/hilary/archive/2008/11/21/fun-with-sequential-form-ids-sql-and-sprocs.aspx
If you look at all the steps involved it should help you ...