You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Create a database scoped credential for accessing the MongoDB source.
@@ -66,6 +67,24 @@ The following Transact-SQL commands are used in this section:
66
67
[ ; ]
67
68
```
68
69
70
+
1. Create an external table.
71
+
72
+
The following script creates te external table. For reference, see [CREATE EXTERNAL TABLE](../../t-sql/statements/create-external-table-transact-sql.md). Before you run the script update it for your environment:
73
+
74
+
-Update the fields with their name, collation, and if they are collections then specify the colection name and the field name, note "friends" is a custom data type.
75
+
-Update the location. Set the database name and the table name. Note three-part names are not allowed, so you can't create it for the system.profile table. Also you can't specify a view because it can't obtain the metadata from it.
76
+
- Update the data source with the name of the one you created in the previous step.
77
+
78
+
```sql
79
+
CREATE EXTERNAL TABLE [MongoDbRandomData](
80
+
[_id] NVARCHAR(24) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
0 commit comments