Skip to content

Commit 6d11e34

Browse files
authored
Merge pull request #89347 from MayMSFT/patch-21
Update how-to-create-register-datasets.md
2 parents 7b7c778 + 5e3fce3 commit 6d11e34

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

articles/machine-learning/service/how-to-create-register-datasets.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@ titanic_ds.take(3).to_pandas_dataframe()
106106
1|2|1|1|Cumings, Mrs. John Bradley (Florence Briggs Th...|female|38.0|1|0|PC 17599|71.2833|C85|C
107107
2|3|1|3|Heikkinen, Miss. Laina|female|26.0|0|0|STON/O2. 3101282|7.9250||S
108108

109+
Use the [`from_sql_query()`](https://docs.microsoft.com/python/api/azureml-core/azureml.data.dataset_factory.tabulardatasetfactory?view=azure-ml-py#from-sql-query-query--validate-true--set-column-types-none-) method on `TabularDatasetFactory` class to read from Azure SQL Database.
110+
111+
```Python
112+
113+
from azureml.core import Dataset, Datastore
114+
115+
# create tabular dataset from a SQL database in datastore
116+
sql_datastore = Datastore.get(workspace, 'mssql')
117+
sql_ds = Dataset.Tabular.from_sql_query((sql_datastore, 'SELECT * FROM my_table'))
118+
```
109119
Use the [`with_timestamp_columns()`](https://docs.microsoft.com/python/api/azureml-core/azureml.data.tabulardataset?view=azure-ml-py#with-timestamp-columns-fine-grain-timestamp--coarse-grain-timestamp-none--validate-false-) method on `TabularDataset` class to enable easy and efficient filtering by time. More examples and details can be found [here](http://aka.ms/azureml-tsd-notebook).
110120

111121
```Python

0 commit comments

Comments
 (0)