One possible way to use SQL server with R is via package RODBC. You should try it first. Then you can go for RDBI package.
I recommend R for using as data mining tool. There are thousands of packages. You should find out what people did in those packages and then you can write your own functions over others work. You dont have to reinvent the wheel, do you?