{"id":292687,"date":"2019-07-29T09:00:39","date_gmt":"2019-07-29T09:00:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=292687"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=292687","title":{"rendered":"\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 R \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Microsoft SQL Server \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0421\u0423\u0411\u0414"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043b\u044c\u0432\u0438\u043d\u0430\u044f \u0434\u043e\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u0430\u0437\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430 \u043a\u0430\u043a\u043e\u043c \u0431\u044b \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u043b\u0438, \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043d\u0438\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0434\u0432\u0443\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 R. \u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Microsoft SQL Server, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a: MySQL, PostgreSQL, SQLite, ClickHouse, Google BigQuery \u0438 \u0434\u0440.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/925\/a23\/786\/925a23786a89917d9a314a793545cbb1.jpg\" alt=\"image\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h1 id=\"soderzhanie\">\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<ul>\n<li><a href=\"#trebuemoe-programnoe-obespechenie\">\u0422\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"#paket-dbi\">\u041f\u0430\u043a\u0435\u0442 DBI<\/a><br \/> \n<ul>\n<li><a href=\"#spisok-osnovnyh-funkciy-dbi\">\u0421\u043f\u0438\u0441\u043e\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 DBI<\/a><\/li>\n<li><a href=\"#podklyuchenie-k-bazam-dannyh\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445<\/a><br \/> \n<ul>\n<li><a href=\"#primer-podklyucheniya-k-microsoft-sql-server-s-pomoschyu-paketa-odbc\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a Microsoft SQL Server \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u0430 odbc<\/a><\/li>\n<li><a href=\"#primer-podklyucheniya-k-microsoft-sql-server-s-pomoschyu-paketa-rmssql\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a Microsoft SQL Server \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u0430 RMSSQL<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#sozdanie-tablic-i-zapis-v-bazu-dannyh\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445<\/a><\/li>\n<li><a href=\"#chtenie-dannyh-iz-subd\">\u0427\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0421\u0423\u0411\u0414<\/a><\/li>\n<li><a href=\"#manipulirovanie-dannymi-v-subd-dml\">\u041c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0421\u0423\u0411\u0414 (DML)<\/a><\/li>\n<li><a href=\"#tranzakcii-v-subd\">\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0432 \u0421\u0423\u0411\u0414<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#paket-rodbc\">\u041f\u0430\u043a\u0435\u0442 RODBC<\/a><br \/> \n<ul>\n<li><a href=\"#osnovnye-funkcii-paketa-rodbc\">\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 RODBC<\/a><\/li>\n<li><a href=\"#primer-raboty-s-rodbc\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 RODBC<\/a><\/li>\n<li><a href=\"#tranzakcionnost\">\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0441\u0442\u044c<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h1 id=\"trebuemoe-programmnoe-obespechenie\">\u0422\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0421\u0423\u0411\u0414 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u043d\u0438\u0436\u0435, \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<ol>\n<li><a href=\"https:\/\/cran.r-project.org\/bin\/windows\/base\/\">\u042f\u0437\u044b\u043a R<\/a>;<\/li>\n<li>\u0421\u0440\u0435\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <a href=\"https:\/\/www.rstudio.com\/products\/rstudio\/download\/#download\">RStudio<\/a>;<\/li>\n<li>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0411\u0430\u0437\u0430\u043c\u0438 \u0414\u0430\u043d\u043d\u044b\u0445, \u043d\u0430 \u0432\u044b\u0431\u043e\u0440:<br \/>  3.1. <a href=\"https:\/\/www.microsoft.com\/ru-RU\/download\/details.aspx?id=55994\">Microsoft SQL Server<\/a><br \/>  3.2. <a href=\"https:\/\/dev.mysql.com\/downloads\/mysql\/\">MySQL<\/a><br \/>  3.3. <a href=\"https:\/\/www.enterprisedb.com\/downloads\/postgres-postgresql-downloads\">PostgreSQL<\/a><\/li>\n<\/ol>\n<p>  <\/p>\n<h1 id=\"paket-dbi\">\u041f\u0430\u043a\u0435\u0442 DBI<\/h1>\n<p>  <\/p>\n<p>\u041f\u0430\u043a\u0435\u0442 <code>DBI<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 R.<\/p>\n<p>  <\/p>\n<p><code>DBI<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430\u043c\u0438 \u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0421\u0423\u0411\u0414).<\/p>\n<p>  <\/p>\n<h3 id=\"spisok-osnovnyh-funkciy-dbi\">\u0421\u043f\u0438\u0441\u043e\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 DBI<\/h3>\n<p>  <\/p>\n<ul>\n<li><code>dbConnect<\/code> \u2014 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445;<\/li>\n<li><code>dbWriteTable<\/code> \u2014 \u0437\u0430\u043f\u0438\u0441\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445;<\/li>\n<li><code>dbReadTable<\/code> \u2014 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445;<\/li>\n<li><code>dbGetQuery<\/code> \u2014 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430;<\/li>\n<li><code>dbSendQuery<\/code> \u2014 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445;<\/li>\n<li><code>dbFetch<\/code> \u2014 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432;<\/li>\n<li><code>dbExecute<\/code> \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \/ \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \/ \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b;<\/li>\n<li><code>dbGetInfo<\/code> \u2014 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438;<\/li>\n<li><code>dbListFields<\/code> \u2014 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u043b\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b;<\/li>\n<li><code>dbListTables<\/code> \u2014 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445;<\/li>\n<li><code>dbExistsTable<\/code> \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445;<\/li>\n<li><code>dbRemoveTable<\/code> \u2014 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445;<\/li>\n<li><code>dbDisconnect<\/code> \u2014 \u0440\u0430\u0437\u0440\u044b\u0432 \u043e\u0442\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"podklyuchenie-k-bazam-dannyh\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u043d\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0421\u0423\u0411\u0414 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442, \u043d\u0438\u0436\u0435 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445.<\/p>\n<p>  <\/p>\n<ul>\n<li><code>odbc<\/code> \u2014 \u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 ODBC \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441;<\/li>\n<li><code>RSQLite<\/code> \u2014 \u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u043a SQLite;<\/li>\n<li><code>RMySQL<\/code> \/ <code>RMariaDB<\/code> \u2014 \u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u043a \u0421\u0423\u0411\u0414 MySQL \u0438 MariaDB;<\/li>\n<li><code>RPostgreSQL<\/code> \u2014 \u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u043a PosrtgreSQL;<\/li>\n<li><code>bigrquery<\/code> \u2014 \u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u043a Google BigQuery;<\/li>\n<li><code>RClickhouse<\/code> \/ <code>clickhouse<\/code> \u2014 \u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u043a ClickHouse;<\/li>\n<li><code>RMSSQL<\/code> \u2014 \u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u043a Microsoft SQL Server (MS SQL), <em>\u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 GitHub<\/em>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u0430\u043a\u0435\u0442 <code>DBI<\/code> \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0430\u0446\u0438\u0435\u0439 R, \u043d\u043e \u043f\u0430\u043a\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430\u043c\u0438 \u043a \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>install.packages(\"\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430\")<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441 GitHub \u0432\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u2014 <code>devtools<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0430\u043a\u0435\u0442 <code>RMSSQL<\/code> \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 R \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0434\u043b\u044f \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">install.packages(\"devtools\") devtools::install_github(\"bescoto\/RMSSQL\")<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"primer-podklyucheniya-k-microsoft-sql-server-s-pomoschyu-paketa-odbc\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a Microsoft SQL Server \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u0430 odbc<\/h4>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 R \u0441\u0435\u0441\u0441\u0438\u0438 \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>library(\"\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430\")<\/code>.<\/p>\n<p>  <\/p>\n<p>\u042f \u043d\u0435\u0441\u043f\u0440\u043e\u0441\u0442\u0430 \u0432\u044b\u0431\u0440\u0430\u043b Microsoft SQL Server \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0421\u0423\u0411\u0414 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d\u0430 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437 R \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 CRAN. <\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044e SQL Server, \u043a\u0430\u043a \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u0430\u044f \u0434\u0440\u0443\u0433\u0430\u044f \u0431\u0430\u0437\u0430 \u0438\u043c\u0435\u0435\u0442 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/ODBC\">ODBC<\/a> (\u0430\u043d\u0433\u043b. Open Database Connectivity) \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0421\u0423\u0411\u0414 \u0447\u0435\u0440\u0435\u0437 ODBC \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 R \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u041f\u0435\u0440\u0432\u044b\u043c \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u043a\u0435\u0442 <code>odbc<\/code>.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414 \u0447\u0435\u0440\u0435\u0437 odbc \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 odbc install.packages(\"odbc\")  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 library(odbc)  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a MS SQL con &lt;- dbConnect(drv = odbc(),                  Driver   = \"SQL Server\",                  Server   = \"localhost\",                  Database = \"mybase\",                  UID      = \"my_username\",                  PWD      = \"my_password\",                  Port     = 1433)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>dbConnect()<\/code> \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c <em>drv<\/em> \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0421\u0423\u0411\u0414 (<code>odbc()<\/code>). \u0422\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u0421\u0423\u0411\u0414, \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430\u043c\u0438 \u0434\u043b\u044f <code>DBI<\/code>. <\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a MS SQL \u0447\u0435\u0440\u0435\u0437 ODBC \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>Driver \u2014 \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 ODBC \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430;<\/li>\n<li>Server \u2014 IP \u0430\u0434\u0440\u0435\u0441 SQL \u0441\u0435\u0440\u0432\u0435\u0440\u0430;<\/li>\n<li>Database \u2014 \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f;<\/li>\n<li>UID \u2014 \u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445;<\/li>\n<li>PWD \u2014 \u041f\u0430\u0440\u043e\u043b\u044c;<\/li>\n<li>Port \u2014 \u041f\u043e\u0440\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0443 SQL Server \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u043e\u0440\u0442 1433.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>ODBC \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a Microsoft SQL Server \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0430\u0446\u0438\u044e Windows, \u043d\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0432 \u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 ODBC. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Windows 10 \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u0443\u0442\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>32-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438: <code>%systemdrive%\\Windows\\SysWoW64\\Odbcad32.exe<\/code><\/li>\n<li>64-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438: <code>%systemdrive%\\Windows\\System32\\Odbcad32.exe<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/c6c\/816\/934\/c6c816934a70e2386a4547d7626d515f.png\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u041f\u041a \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>odbcListDrivers()<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">   name                                  attribute        value                                       &lt;chr&gt;                                 &lt;chr&gt;            &lt;chr&gt;                                     1 SQL Server                            APILevel         2                                         2 SQL Server                            ConnectFunctions YYY                                       3 SQL Server                            CPTimeout        60                                        4 SQL Server                            DriverODBCVer    03.50                                     5 SQL Server                            FileUsage        0                                         6 SQL Server                            SQLLevel         1                                         7 SQL Server                            UsageCount       1                                         8 MySQL ODBC 5.3 ANSI Driver            UsageCount       1                                         9 MySQL ODBC 5.3 Unicode Driver         UsageCount       1                                        10 Simba ODBC Driver for Google BigQuery Description      Simba ODBC Driver for Google BigQuery2.0 # ... with 50 more rows<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043a\u0430\u0447\u0430\u0442\u044c ODBC \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0421\u0423\u0411\u0414 \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0430\u043c:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/dev.mysql.com\/downloads\/connector\/odbc\/\">MySQL<\/a><\/li>\n<li><a href=\"https:\/\/odbc.postgresql.org\/\">PostgreSQL<\/a><\/li>\n<li><a href=\"https:\/\/cloud.google.com\/bigquery\/providers\/simba-drivers\/\">Google BigQuery<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0421\u0423\u0411\u0414 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<ul>\n<li>PostgreSQL \/ MySQL \/ MariaDB \u2014 user, password, host, port, dbname;<\/li>\n<li>GoogleBigQuery \u2014 project, dataset;<\/li>\n<li>ClickHouse \u2014 user, password, db, port, host;<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 ODBC \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u0430\u0441\u0442\u0435\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f ODBC \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 &#171;\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 DSN&#187; \u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c&#8230;&#187;.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/9ae\/e92\/ba3\/9aee92ba30bdc8de811623aae1fb58fa.png\"><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0432\u044b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0435 \u0435\u043c\u0443 \u0438\u043c\u044f, DSN (Data Source Name). <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b03\/a0c\/a7c\/b03a0ca7c90fa0d5bddccb53575563a3.png\"><\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 DSN &#171;my_test_source&#187;. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a Microsoft SQL Server, \u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414 \u0447\u0435\u0440\u0435\u0437 odbc \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c DSN<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 DSN con &lt;- dbConnect(odbc(),                 DSN = \"my_test_source\",                 UID = \"my_username\",                 PWD = \"my_password\")<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u0432\u0441\u0435\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u041f\u041a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 ODBC \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>odbcListDataSources()<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">   name            description                              &lt;chr&gt;           &lt;chr&gt;                                  1 BQ              Simba ODBC Driver for Google BigQuery  2 BQ_main         Simba ODBC Driver for Google BigQuery  3 BQ ODBC         Simba ODBC Driver for Google BigQuery  4 OLX             Simba ODBC Driver for Google BigQuery  5 Multicharts     Simba ODBC Driver for Google BigQuery  6 PostgreSQL35W   PostgreSQL Unicode(x64)                7 hillel_bq       Simba ODBC Driver for Google BigQuery  8 blog_bq         Simba ODBC Driver for Google BigQuery  9 MyClientMSSQL   SQL Server                            10 local_mssql     SQL Server                            11 MSSQL_localhost SQL Server                            12 my_test_source  SQL Server                            13 Google BigQuery Simba ODBC Driver for Google BigQuery<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"primer-podklyucheniya-k-microsoft-sql-server-s-pomoschyu-paketa-rmssql\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a Microsoft SQL Server \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u0430 RMSSQL<\/h3>\n<p>  <\/p>\n<p><code>RMSSQL<\/code> \u043d\u0435 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043d\u0430 CRAN, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441 GitHub \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u0430 <code>devtools<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">install.packages(\"devtools\") devtools::install_github(\"bescoto\/RMSSQL\")<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DBI \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 RMSSQL<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 library(RJDBC) library(RMSSQL) library(DBI)  # \u0447\u0435\u0440\u0435\u0437 RMSSQL con &lt;- dbConnect(MSSQLServer(),                   host     = 'localhost',                   user     = 'my_username',                   password = 'my_password',                   dbname   = \"mybase\")<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442 <code>DBI<\/code>, \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u0422.\u0435. \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u2014 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <em>drv<\/em> \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>dbConnect<\/code>, \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u2014 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043d\u0443\u0436\u043d\u043e\u0439 \u0432\u0430\u043c \u0421\u0423\u0411\u0414.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a MySQL, PostgreSQL, SQLite \u0438 BigQuery<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a MySQL library(RMySQL)  con &lt;- dbConnect(MySQL(),                   host     = 'localhost',                   user     = 'my_username',                   password = 'my_password',                   dbname   = \"mybase\",                  host     = \"localhost\")  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a PostrgeSQL library(RPostgreSQL)  con &lt;- dbConnect(PostgreSQL(),                   host     = 'localhost',                   user     = 'my_username',                   password = 'my_password',                   dbname   = \"mybase\",                  host     = \"localhost\")  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a PostrgeSQL library(RPostgreSQL)  con &lt;- dbConnect(PostgreSQL(),                   host     = 'localhost',                   user     = 'my_username',                   password = 'my_password',                   dbname   = \"mybase\",                  host     = \"localhost\")  # \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a SQLite library(RSQLite)  # connection or create base con &lt;- dbConnect(drv = SQLite(),                  \"localhost.db\")  # \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a Google BigQuery library(bigrquery)  con &lt;- dbConnect(drv     = bigquery(),                  project = \"my_proj_id\",                  dataset = \"dataset_name\")<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h3 id=\"sozdanie-tablic-i-zapis-v-bazu-dannyh\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0438\u0441\u044c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>dbWriteTable()<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>dbWriteTable()<\/code>: <\/p>\n<p>  <\/p>\n<p><em>\u0416\u0438\u0440\u043d\u044b\u043c \u0448\u0440\u0438\u0444\u0442\u043e\u043c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u0443\u0440\u0441\u0438\u0432\u043e\u043c \u2014 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435<\/em><\/p>\n<p>  <\/p>\n<ul>\n<li><strong>conn<\/strong> \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0421\u0423\u0411\u0414, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>dbConnect<\/code>;<\/li>\n<li><strong>name<\/strong> \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0421\u0423\u0411\u0414, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435;<\/li>\n<li><strong>value<\/strong> \u2014 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 (\u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 data.frame \/ data.table \/ tibble_frame) \u0432 R, \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0421\u0423\u0411\u0414;<\/li>\n<li><em>row.names<\/em> \u2014 \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 row_names, \u0441 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 \u0441\u0442\u0440\u043e\u043a, <em>\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 FALSE<\/em>.<\/li>\n<li><em>overwrite<\/em> \u2014 \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0435\u0441\u043b\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 <em>name<\/em> \u0443\u0436\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0432\u0443\u0435\u0442 \u0432 \u0421\u0423\u0411\u0414, <em>\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 FALSE<\/em>;<\/li>\n<li><em>append<\/em> \u2014 \u0414\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0435\u0441\u043b\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 <em>name<\/em> \u0443\u0436\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0432\u0443\u0435\u0442 \u0432 \u0421\u0423\u0411\u0414, <em>\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 FALSE<\/em>;<\/li>\n<li><em>field.types<\/em> \u2014 \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440, \u0438 \u0437\u0430\u0434\u0430\u0451\u0442 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u043e\u043b\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0421\u0423\u0411\u0414, <em>\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 NULL<\/em>;<\/li>\n<li><em>temporary<\/em> \u2014 \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0421\u0423\u0411\u0414, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0440\u0430\u0437\u0440\u044b\u0432\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439, <em>\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 FALSE<\/em>.<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0421\u0423\u0411\u0414 \u0447\u0435\u0440\u0435\u0437 DBI<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442 library(odbc) # \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c\u0441\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 DSN con &lt;- dbConnect(odbc(),                 DSN = \"my_test_source\",                 UID = \"my_username\",                 PWD = \"my_password\") # \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0432 \u0431\u0430\u0437\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 iris, \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043d\u0435\u0451 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0432 R \u043d\u0430\u0431\u043e\u0440\u0430 iris dbWriteTable(conn  = con,              name  = \"iris\",               value = iris)  # \u0440\u0430\u0437\u0440\u044b\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0411\u0414 dbDisconnect(con)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0442\u0430\u0431\u043b\u0438\u0446 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0436\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>dbListTables()<\/code>, \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 <code>dbRemoveTable()<\/code><\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0437 \u0421\u0423\u0411\u0414<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 library(odbc)  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414 con &lt;- dbConnect(odbc(),                  DSN = \"my_test_source\",                  UID = \"my_username\",                  PWD = \"my_password\")  # \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446 dbListTables(con) # \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b iris dbRemoveTable(con, \"iris\")  # \u0440\u0430\u0437\u0440\u044b\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0411\u0414 dbDisconnect(con)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h3 id=\"chtenie-dannyh-iz-subd\">\u0427\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0421\u0423\u0411\u0414<\/h3>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>DBI<\/code> \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u043b\u0438\u0431\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0446\u0435\u043b\u0438\u043a\u043e\u043c, \u043b\u0438\u0431\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e SQL \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>dbReadTable()<\/code> \u0438 <code>dbGetQuery()<\/code>.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b iris \u0438\u0437 \u0421\u0423\u0411\u0414<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 library(odbc)  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414 con &lt;- dbConnect(odbc(),                  DSN = \"my_test_source\",                  UID = \"my_username\",                  PWD = \"my_password\")  # \u0437\u0430\u0433\u0440\u0443\u0436\u0437\u043a\u0430 \u0442\u0430\u0431\u043e\u0438\u0446\u044b iris \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 iris dbiris &lt;- dbReadTable(con, \"iris\")  # \u0440\u0430\u0437\u0440\u044b\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0411\u0414 dbDisconnect(con)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f SQL \u0438\u0437 \u0421\u0423\u0411\u0414<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 library(odbc)  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414 con &lt;- dbConnect(odbc(),                  DSN = \"my_test_source\",                  UID = \"my_username\",                  PWD = \"my_password\")  # \u0417\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 setosa &lt;- dbGetQuery(con,                      \"SELECT * FROM iris WHERE Species = 'setosa'\")  # \u0440\u0430\u0437\u0440\u044b\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0411\u0414 dbDisconnect(con)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h3 id=\"manipulirovanie-dannymi-v-subd-dml\">\u041c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0421\u0423\u0411\u0414 (DML)<\/h3>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>dbGetQuery()<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 (SELECT).<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a UPDATE, INSERT, DELETE, \u0432 <code>DBI<\/code> \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>dbExecute()<\/code>.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0421\u0423\u0411\u0414<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 library(odbc)  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414 con &lt;- dbConnect(odbc(),                  DSN = \"my_test_source\",                  UID = \"my_username\",                  PWD = \"my_password\")  # \u0412\u0441\u0442\u0430\u0432\u043a\u0430 \u0441\u0442\u0440\u043e\u043a (INSERT) dbExecute(con,            \"INSERT INTO iris (row_names, [Sepal.Length], [Sepal.Width], [Petal.Length], [Petal.Width], [Species])            VALUES (51, 5.0, 3.3, 1.7, 0.3, 'new_values')\")  # \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (UPDATE) dbExecute(con,            \"UPDATE iris            SET [Species] = 'old_value'            WHERE row_names = 51\")  # \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b (DELETE) dbExecute(con, \"DELETE FROM iris WHERE row_names = 51\")  # \u0440\u0430\u0437\u0440\u044b\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0411\u0414 dbDisconnect(con)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h3 id=\"tranzakcii-v-subd\">\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0432 \u0421\u0423\u0411\u0414<\/h3>\n<p>  <\/p>\n<blockquote><p>\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438. \u041e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435\u043c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u0431\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 (\u0444\u0438\u043a\u0441\u0430\u0446\u0438\u044f, commit) \u043b\u0438\u0431\u043e \u043e\u0442\u043c\u0435\u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 (\u043e\u0442\u043a\u0430\u0442, rollback). \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u0411\u0414 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u044d\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0430\u043a\u0442\u0443\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441.<\/p><\/blockquote>\n<p><em><a href=\"https:\/\/habr.com\/ru\/post\/446662\/\">\u0426\u0438\u0442\u0430\u0442\u0430 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 &#171;\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0438\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f&#187;<\/a><\/em><\/p>\n<p>  <\/p>\n<p>\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 SQL \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u0443\u044e \u0435\u0434\u0438\u043d\u0438\u0446\u0443. \u0412 <code>DBI<\/code> \u043d\u0430\u0447\u0430\u043b\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>dbBegin()<\/code> \u0438 \u0434\u0430\u043b\u0435\u0435 \u043b\u0438\u0431\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>dbCommit()<\/code>, \u043b\u0438\u0431\u043e \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>dbRollback()<\/code>. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0421\u0423\u0411\u0414 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e: \u043b\u0438\u0431\u043e \u0432\u0441\u0435, \u043b\u0438\u0431\u043e \u043d\u0438 \u043e\u0434\u043d\u043e \u0438\u0437 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b \u043a \u0434\u0430\u043d\u043d\u044b\u043c. <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432 \u0445\u043e\u0434\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 iris 51 \u0441\u0442\u0440\u043e\u043a\u0443, \u0434\u0430\u043b\u0435\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>Sepal.Width<\/em> \u0432 5 \u0441\u0442\u0440\u043e\u043a\u0435, \u0438 \u0443\u0434\u0430\u043b\u0438\u043c 43 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 library(odbc)  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414 con &lt;- dbConnect(odbc(),                  DSN = \"my_test_source\",                  UID = \"my_username\",                  PWD = \"my_password\")  # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043e \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 dbGetQuery(con, \"SELECT * FROM iris WHERE row_names IN (5, 43, 51)\")  #   row_names Sepal.Length Sepal.Width Petal.Length Petal.Width    Species # 1         5          5.0         3.6          1.4         0.2     setosa # 2        43          4.4         3.2          1.3         0.2     setosa # 3        51          7.0         3.2          4.7         1.4 versicolor  # \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 dbBegin(con)  # \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 dbExecute(con,            \"INSERT INTO iris            (row_names, [Sepal.Length], [Sepal.Width], [Petal.Length], [Petal.Width], [Species])            VALUES (51, 5.0, 3.3, 1.7, 0.3, 'new_values')\")  # \u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443  dbExecute(con,            \"UPDATE iris            SET [Sepal.Width] = 8            WHERE row_names = 5\")  # \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 43 dbExecute(con, \"DELETE FROM iris WHERE row_names = 43\")  # \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u043c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e dbCommit(con)  # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 dbGetQuery(con, \"SELECT * FROM iris WHERE row_names IN (5, 43, 51)\")  #   row_names Sepal.Length Sepal.Width Petal.Length Petal.Width    Species # 1         5            5         8.0          1.4         0.2     setosa # 2        51            7         3.2          4.7         1.4 versicolor # 3        51            5         3.3          1.7         0.3 new_values<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043e\u0442\u043c\u0435\u043d\u044b \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 library(odbc)  # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414 con &lt;- dbConnect(odbc(),                  DSN = \"my_test_source\",                  UID = \"my_username\",                  PWD = \"my_password\")  # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043e \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 dbGetQuery(con, \"SELECT * FROM iris WHERE row_names IN (5, 43, 51)\")  #   row_names Sepal.Length Sepal.Width Petal.Length Petal.Width    Species # 1         5          5.0         3.6          1.4         0.2     setosa # 2        43          4.4         3.2          1.3         0.2     setosa # 3        51          7.0         3.2          4.7         1.4 versicolor  # \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 dbBegin(con)  # \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 dbExecute(con,            \"INSERT INTO iris            (row_names, [Sepal.Length], [Sepal.Width], [Petal.Length], [Petal.Width], [Species])            VALUES (51, 5.0, 3.3, 1.7, 0.3, 'new_values')\")  # \u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443  dbExecute(con,            \"UPDATE iris            SET [Sepal.Width] = 8            WHERE row_names = 5\")  # \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 43 dbExecute(con, \"DELETE FROM iris WHERE row_names = 43\")  # \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u043c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e dbRollback(con)  # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 dbGetQuery(con, \"SELECT * FROM iris WHERE row_names IN (5, 43, 51)\")  #   row_names Sepal.Length Sepal.Width Petal.Length Petal.Width    Species # 1         5          5.0         3.6          1.4         0.2     setosa # 2        43          4.4         3.2          1.3         0.2     setosa # 3        51          7.0         3.2          4.7         1.4 versicolor<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h1 id=\"paket-rodbc\">\u041f\u0430\u043a\u0435\u0442 RODBC<\/h1>\n<p>  <\/p>\n<p>\u041f\u0430\u043a\u0435\u0442 <code>RODBC<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0421\u0423\u0411\u0414 \u0447\u0435\u0440\u0435\u0437 ODBC \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  <\/p>\n<p><code>RODBC<\/code> \u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 <code>DBI<\/code>, \u0442.\u0435. \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>RODBC<\/code> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u043c <code>DBI<\/code>.<\/p>\n<p>  <\/p>\n<h3 id=\"osnovnye-funkcii-paketa-rodbc\">\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 RODBC<\/h3>\n<p>  <\/p>\n<ul>\n<li><code>odbcConnect<\/code> \u2014 \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0421\u0423\u0411\u0414 \u0447\u0435\u0440\u0435\u0437 DSN;<\/li>\n<li><code>odbcDriverConnect<\/code> \u2014 \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f;<\/li>\n<li><code>sqlQuery<\/code> \u2014 \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0421\u0423\u0411\u0414, \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430: SELECT, UPDATE, INSERT, DELETE.<\/li>\n<li><code>sqlFetch<\/code> \u2014 \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u0437 \u0421\u0423\u0411\u0414;<\/li>\n<li><code>sqlTables<\/code> \u2014 \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446 \u0432 \u0431\u0430\u0437\u0435.<\/li>\n<li><code>sqlSave<\/code> \u2014 \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443;<\/li>\n<li><code>sqlUpdate<\/code> \u2014 \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0421\u0423\u0411\u0414;<\/li>\n<li><code>sqlDrop<\/code> \u2014 \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0421\u0423\u0411\u0414;<\/li>\n<li><code>odbcClose<\/code> \u2014 \u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0421\u0423\u0411\u0414.<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"primer-raboty-s-rodbc\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 RODBC<\/h3>\n<p>  <\/p>\n<p>\u0421 \u043c\u043e\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f <code>RODBC<\/code> \u043c\u0435\u043d\u0435\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0435\u043d \u0447\u0435\u043c <code>DBI<\/code>, \u043d\u043e \u0432 \u043d\u0451\u043c \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0421\u0423\u0411\u0414.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0421\u0423\u0411\u0414 \u0447\u0435\u0440\u0435\u0437 RODBC<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 library(RODBC) # \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f con_string &lt;- odbcDriverConnect(connection = \"Driver=SQL Server;Server=localhost;Database=mybase;UID=my_username;PWD=my_password;Port=1433\") # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 DSN con_dsn    &lt;- odbcConnect(dsn = \"my_test_source\",                           uid = \"my_username\",                           pwd = \"my_password\")  # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0435 sqlSave(con_dsn,         dat       = iris,         tablename = \"iris\")  # \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0442\u0430\u0431\u0434\u0438\u0446\u0443 iris sqlSave(con_dsn,         dat       = iris,         tablename = \"iris\",         append    = TRUE)  # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 4 \u0441\u0442\u0440\u043e\u043a\u0438 sqlFetch(con_dsn, \"iris\", rownames = FALSE, max = 4)  # \u0432\u043d\u043e\u0441\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 R iris[1, 5] &lt;- \"virginica\"  # \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0442\u0430\u0431\u0438\u0446\u0443 \u0432 \u0421\u0423\u0411\u0414 sqlUpdate(con_dsn,           dat       = iris,           tablename = \"iris\")  # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 4 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 sqlFetch(con_dsn, \"iris\", rownames = FALSE, max = 4)  # \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b sqlDrop(con_dsn, sqtable = \"iris\")  # \u0440\u0430\u0437\u0440\u044b\u0432 \u0441\u043e\u0435\u0434\u0435\u043d\u0435\u043d\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 odbcCloseAll()<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h1 id=\"tranzakcionnost\">\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0441\u0442\u044c<\/h1>\n<p>  <\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u0432 <code>RODBC<\/code> \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f\u043c\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438.<\/p>\n<p>  <\/p>\n<ul>\n<li><code>odbcSetAutoCommit<\/code> \u2014 \u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0421\u0423\u0411\u0414;<\/li>\n<li><code>odbcEndTran<\/code> \u2014 \u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u043d\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>odbcSetAutoCommit<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <em>autoCommit<\/em>.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0440\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0432 RODBC<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 library(RODBC) # \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 DSN con_dsn    &lt;- odbcConnect(dsn = \"my_test_source\",                           uid = \"my_username\",                           pwd = \"my_password\")  # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0435 sqlSave(con_dsn,         dat       = iris,         tablename = \"iris\")  # \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430 odbcSetAutoCommit(con_dsn, autoCommit = FALSE)  # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 4 \u0441\u0442\u0440\u043e\u043a\u0438 sqlFetch(con_dsn, \"iris\", rownames = FALSE, max = 4)  #   rownames SepalLength SepalWidth PetalLength PetalWidth Species # 1        1         5.1        3.5         1.4        0.2  setosa # 2        2         4.9        3.0         1.4        0.2  setosa # 3        3         4.7        3.2         1.3        0.2  setosa # 4        4         4.6        3.1         1.5        0.2  setosa  # \u0432\u043d\u043e\u0441\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 R iris[1, 5] &lt;- \"virginica\"  # \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0442\u0430\u0431\u0438\u0446\u0443 \u0432 \u0421\u0423\u0411\u0414 sqlUpdate(con_dsn,           dat       = iris,           tablename = \"iris\")  # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 4 \u0441\u0442\u0440\u043e\u043a\u0438 sqlFetch(con_dsn, \"iris\", rownames = FALSE, max = 4)  #   rownames SepalLength SepalWidth PetalLength PetalWidth   Species # 1        1         5.1        3.5         1.4        0.2 virginica # 2        2         4.9        3.0         1.4        0.2    setosa # 3        3         4.7        3.2         1.3        0.2    setosa # 4        4         4.6        3.1         1.5        0.2    setosa  # \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f odbcEndTran(con_dsn, commit = FALSE)  # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 4 \u0441\u0442\u0440\u043e\u043a\u0438 sqlFetch(con_dsn, \"iris\", rownames = FALSE, max = 4)  #   rownames SepalLength SepalWidth PetalLength PetalWidth Species # 1        1         5.1        3.5         1.4        0.2  setosa # 2        2         4.9        3.0         1.4        0.2  setosa # 3        3         4.7        3.2         1.3        0.2  setosa # 4        4         4.6        3.1         1.5        0.2  setosa  # \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0442\u0430\u0431\u0438\u0446\u0443 \u0432 \u0421\u0423\u0411\u0414 sqlUpdate(con_dsn,           dat       = iris,           tablename = \"iris\")  # \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f odbcEndTran(con_dsn, commit = TRUE)  # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 4 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 sqlFetch(con_dsn, \"iris\", rownames = FALSE, max = 4)  #   rownames SepalLength SepalWidth PetalLength PetalWidth   Species # 1        1         5.1        3.5         1.4        0.2 virginica # 2        2         4.9        3.0         1.4        0.2    setosa # 3        3         4.7        3.2         1.3        0.2    setosa # 4        4         4.6        3.1         1.5        0.2    setosa  # \u0440\u0430\u0437\u0440\u044b\u0432 \u0441\u043e\u0435\u0434\u0435\u043d\u0435\u043d\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 odbcClose(con_dsn)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h1 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u0414\u0432\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 R, <code>DBI<\/code> \u0438 <code>RODBC<\/code>, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b, \u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441 \u043b\u044e\u0431\u043e\u0439 \u0421\u0423\u0411\u0414. <\/p>\n<p>  <\/p>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0421\u0423\u0411\u0414 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0421\u0423\u0411\u0414 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430\u043c\u0438. \u0414\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0421\u0423\u0411\u0414 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 ODBC \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u043a\u0435\u0442\u044b <code>odbc<\/code> \u0438\u043b\u0438 <code>RODBC<\/code>. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438, \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0432\u0430\u043c\u0438 \u0421\u0423\u0411\u0414, \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b. \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 SQL \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 SQL \u0434\u0438\u0430\u043b\u0435\u043a\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0421\u0423\u0411\u0414 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435.<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/461063\/\"> https:\/\/habr.com\/ru\/post\/461063\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043b\u044c\u0432\u0438\u043d\u0430\u044f \u0434\u043e\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u0430\u0437\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430 \u043a\u0430\u043a\u043e\u043c \u0431\u044b \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u043b\u0438, \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043d\u0438\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0434\u0432\u0443\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 R. \u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Microsoft SQL Server, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a: MySQL, PostgreSQL, SQLite, ClickHouse, Google BigQuery \u0438 \u0434\u0440.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/925\/a23\/786\/925a23786a89917d9a314a793545cbb1.jpg\" alt=\"image\"><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-292687","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/292687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=292687"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/292687\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=292687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=292687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=292687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}