File tree Expand file tree Collapse file tree 1 file changed +1
-36
lines changed
7.Reading from SQL Databases Expand file tree Collapse file tree 1 file changed +1
-36
lines changed Original file line number Diff line number Diff line change 11# Reading from SQL databases}
22
33library(RODBC )
4+
45connStr <- paste(
56 " Server=msedxeus.database.windows.net" ,
67 " Database=DAT209x01" ,
@@ -25,42 +26,6 @@ if(.Platform$OS.type != "windows"){
2526
2627conn <- odbcDriverConnect(connStr )
2728
28- \end {itemize }
29- \end {itemize }
30- \end {frame }
31-
32-
33- \begin {frame }[fragile ]%% \linespread {0.9 }
34- \frametitle {Connecting to a local SQL Database on your harddisk : }
35- \begin {itemize }
36- \item Replace server name with the SQL server name on the local machine ;
37-
38- \item With the default SQL installation , this is equal to the {\bf name of the local machine }:
39-
40-
41- \begin {Sinput }
42- > connStr <- paste(
43- + " Server=My_Machine" ,
44- + " Database=DAT205x01" ,
45- + " uid=PBIlogin" ,
46- + " pwd=P@ssw0rd" ,
47- + " Driver={SQL Server}" ,
48- + sep = " ;"
49- + )
50-
51- connStr <- paste(
52- " Server=msedxeus.database.windows.net" ,
53- " Database=DAT209x01" ,
54- " uid=PBIlogin" ,
55- " pwd=P@ssw0rd" ,
56- " Driver=FreeTDS" ,
57- " TDS_Version=8.0" ,
58- " Port=1433" ,
59- sep = " ;"
60- )
61-
62- conn <- odbcDriverConnect(connStr )
63-
6429# A first query
6530
6631tab <- sqlTables(conn )
You can’t perform that action at this time.
0 commit comments