In reply to Laurent.

Thank you, it work fine. I noticed I have to provide the admin password, I've tried to pwencode it, but setpassword doesn't recognize it. We use IWA, my login has admin privilege, so for it to work for all my users in my stored proc, I should probably make an internal account with admin privilege and never change the password or is there another way ?

Thanks!