Do you want to record keyboard midi in Sonar or Audio from Ketron SD2 or both ?

You should be able to connect your keyboard straight to the Ketron SD2 then connect the Ketron SD2 audio and midi to the UR22 then in Sonar select UR22 as midi in and audio in.