sp with @code parameter support