HomeНаука и техникаRelated VideosMore From: Rob Kerr

Importing data from SQL Server to R Studio via ODBC

143 ratings | 30819 views
This lesson shows how to use ODBC to import data from SQL Server to R Studio directly using SQL.
Html code for embedding videos on your blog
Text Comments (36)
Nirvana Moksh (2 days ago)
Can we run a Stored Procedure with a Date parameter in a similar fashion?
Abhijeet Kelkar (25 days ago)
Thanks a LOT !!! Folks, If You have a Windows Auth SQL Connection, Then just mention the DSN name in the con <- () part. For SQL Auth, we need to mention Userid and Password as he describes !!. Thanks a LOT!
Syed Aleem (2 months ago)
I owe you a beer too man.. was breaking my had for the last 3 hours to get this right.. great work buddy...
Mygirlinyesterday Lie (2 months ago)
very helpful thank you so much <3
Sevilay Cetintas (2 months ago)
however when the same R script is published onto Power BI service, it throws an error, "ODBC connection failed". how to get around this issue?
Aravind Damacharla (4 months ago)
Thanks a lot. I have trying many things (mostly on 'odbcDriverConnect()') from the past 2 hrs and was unsuccessful in establishing a connection. This explained simply and solved within couple of minutes.
Appiah Desmond (5 months ago)
I do get this error when i run my query. could you tell me what im doing wrong desss <-sqlQuery(conn, "select * from departments") "Error in odbcFetchRows(channel, max = max, buffsize = buffsize, nullstring = nullstring, : negative length vectors are not allowed"
Xinzhu Zhao (6 months ago)
U R AWESOME. I've spent the whole night searching for answers why I can't connect my database to R. And your video is the one that finally resolves the puzzle. I missed the step create an ODBC datasource which is the first step you do. I can finnally start analyzing my data now! Thank you!
sachin sharma (6 months ago)
Thanks Rob. Very helpful and works fine. Is there a way I can hid my Password in odbcconnect statement? I have windows authentication on SQL server on my work laptop.
Amazing!!!! Thank you so much, I was having a really bad time whit that!
josue zavala (10 months ago)
Very very usefull, organized, concise and perfect :) thank you so much
Satish Chilloji (11 months ago)
Awsome Rob
Stephen Witkowski (1 year ago)
Great tutorial!
Sandeep Prabhu (1 year ago)
Thanks!! I owe you a beer too!
Ahmed Ashraf (1 year ago)
You Are A Life Saver <3 !!!
guru prasad (1 year ago)
thanks a lot. i had missed specifying the database when creating the dsn. now working thanks to you.
selen kökten (1 year ago)
It works, thx !
carl wilburn (1 year ago)
Thanks for the video. I've googled this topic, but this was much more straight forward than trying to digest the info from those google searches.
Marcel Vološin (1 year ago)
i owe you a beer :)
Sandeep Prabhu (1 year ago)
I owe him a bear too! :)
Trayfen O'Donnell (2 years ago)
What about to a remote server? What about though a proxy?
Q Ultimas (1 year ago)
Actually ty for your response I just got it working. I think my original problem had to do with using the ip over localhost.
Trayfen O'Donnell (1 year ago)
Is it: A: Working with the SSH Tunnel? B: Working with the database? C: Working with R in the database? D: All of the above.
Q Ultimas (1 year ago)
been trying to figure out how to connect to a remote mariadb server through ssh tunneling and just so confused lol.
MrGoudstad (2 years ago)
Thank you.
Ivan Oboth (2 years ago)
great stuff.. thanks for this
Víctor Lopez (2 years ago)
Thanks for all the time you've saved me!
dharmender yadav (3 years ago)
Thanks a lot. This is exactly what i wanted. :-)
pato lobos (3 years ago)
Rob do you know how to do the same, but against a SSAS Tabular instance via https?
Bad Driving Croatia (3 years ago)
Thank you
Kai-Shen Tseng (4 years ago)
Your video helps me a lot! Thank you very much!
Kai-Shen Tseng (2 years ago)
+曾凱聲 After a year, I reinstall my computer, and I forgot how to set again...but I finally got this video again!! Thx again!
Diego Calderon (4 years ago)
Personally, I had to install the 'ODBC Driver 11 for SQL Server' on my machine before I could follow your procedure...but this worked for me.  Thanks for the great video!
Dr. ALVR Chowdary (4 years ago)
Good and useful
Ryan Anderson (4 years ago)
this is great- thank you!
Cameron Billings (4 years ago)
Fantastic video! Nice, concise and clear. Haven't given this a shot yet but I will be tomorrow.  Thanks for the upload!

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.