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
Copy file name to clipboardExpand all lines: articles/stream-analytics/sql-db-table.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,24 +14,24 @@ Azure Stream Analytics supports Azure SQL Database as an output for your streami
14
14
15
15
1. Create a Stream Analytics job.
16
16
17
-
2. Create a Azure SQL Database to which your Stream Analytics job will write output.
17
+
2. Create an Azure SQL Database to which your Stream Analytics job will write output.
18
18
19
19
## Write to a new table in SQL Database
20
20
21
-
This section describes how you can configure your job to write to a table in your Azure SQL Database that has not yet been created.
21
+
This section describes how you can configure your job to write to a table in your Azure SQL Database that hasn't yet been created.
22
22
23
23
1. In your Stream Analytics job, select **Outputs** under **Job topology**. Click **Add** and choose **SQL Database**.
24
24
25
25
:::image type="content" source="./media/sql-db-output-managed-identity/sql-database-output.png" alt-text="Screenshot showing SQL DB output in Stream Analytics" lightbox="./media/sql-db-output-managed-identity/sql-database-output.png":::
26
26
27
-
2. Select an output alias which will be used in your job’s query. Provide your database name and authentication mode. You can learn more about [SQL output configuration options](sql-database-output.md).
27
+
2. Select an output alias that will be used in your job’s query. Provide your database name and authentication mode. You can learn more about [SQL output configuration options](sql-database-output.md).
28
28
29
-
3. Enter a **table name** that you want to create in your Azure SQL Database. Click **Save**. Note that saving this output doesn’t create the table in your SQL Database. Next steps provide more details on when the table gets created.
29
+
3. Enter a **table name** that you want to create in your Azure SQL Database. Click **Save**. Note: Saving this output doesn’t create the table in your SQL Database. Next steps provide more details on when the table gets created.
30
30
31
31
:::image type="content" source="./media/sql-db-output-managed-identity/new-table-name.png" alt-text="Screenshot showing SQL DB output configuration in Stream Analytics" lightbox="./media/sql-db-output-managed-identity/new-table-name.png":::
32
32
33
33
4. Select **Query** under **Job Topology** and use the alias in your query to write the output in the table name you provided in previous step. Click **Test query** to test the query logic and view **Test results** which shows schema of the output that will be produced by the job.
34
-
Note: To test your query, you need to have either incoming streaming data in your input source or you can upload sample data to test query. You can learn more about [Test Stream Analytics query](stream-analytics-test-query.md).
34
+
Note: To test your query, you need to have either incoming streaming data in your input source, or you can upload sample data to test query. You can learn more about [Test Stream Analytics query](stream-analytics-test-query.md).
@@ -41,7 +41,7 @@ Note: To test your query, you need to have either incoming streaming data in you
41
41
42
42
:::image type="content" source="./media/sql-db-output-managed-identity/create-table-popup.png" alt-text="Screenshot showing creating a table in SQL database from Stream Analytics" lightbox="./media/sql-db-output-managed-identity/create-table-popup.png":::
43
43
44
-
If your Stream Analytics query is modified to produce different schema, you will need to alter your table definition in your SQL Database. This ensures that the Stream Analytics job doesn’t encounter data conversion errors while trying to write to the sink.
44
+
If your Stream Analytics query is modified to produce different schema, you'll need to alter your table definition in your SQL Database. This ensures that the Stream Analytics job doesn’t encounter data conversion errors while trying to write to the sink.
45
45
46
46
6. Once your query is final, select **Overview** and **Start** the job. You can then navigate to the SQL Database table to see your streaming query output.
47
47
@@ -53,35 +53,35 @@ This section describes how you can configure your job to write to a table that a
53
53
54
54
:::image type="content" source="./media/sql-db-output-managed-identity/sql-database-output.png" alt-text="Screenshot showing SQL DB output in Stream Analytics" lightbox="./media/sql-db-output-managed-identity/sql-database-output.png":::
55
55
56
-
2. Select an output alias which will be used in your job’s query. Provide your database name and authentication mode. You can learn more about [SQL output configuration options](sql-database-output.md).
56
+
2. Select an output alias that will be used in your job’s query. Provide your database name and authentication mode. You can learn more about [SQL output configuration options](sql-database-output.md).
57
57
58
58
3. You can pick an existing table from the selected SQL Database by entering your SQL Authentication details. This will load a list of table names from your Database. Select the table name from the list or manually enter table name and **Save**.
4. Select **Query** under **Job Topology** and use the alias name in your query to write the output in the selected table. Click **Test query** to test the query logic and view **Test results**.
63
-
Note: To test your query, you need to have either incoming streaming data in Event Hub/IoT Hub or you can upload sample data to test query. You can learn more about [Test Stream Analytics query](stream-analytics-test-query.md).
63
+
Note: To test your query, you need to have either incoming streaming data in Event Hub/IoT Hub, or you can upload sample data to test query. You can learn more about [Test Stream Analytics query](stream-analytics-test-query.md).
5. In **SQL table schema** tab, you can see a column name and its type from incoming data and in the selected table. You can see the status whether the incoming data type and selected SQL table match or not. If its not a match, you will be prompted to update your query to match table schema.
69
+
5. In **SQL table schema** tab, you can see a column name and its type from incoming data and in the selected table. You can see the status whether the incoming data type and selected SQL table match or not. If it's not a match, you'll be prompted to update your query to match table schema.
6. Once your query is final, select **Overview** and **Start** the job. You can then navigate to the SQL Database table to see your streaming query output.
74
74
75
75
## Common data type mismatch reasons
76
76
77
-
It is very important to ensure that the output of your Stream Analytics job matches the column names and data types expected by your SQL Database table. If there is a mismatch, your job will run into data conversion errors and continuously retry until the SQL table definition is changed. You can [change your job’s behavior](stream-analytics-output-error-policy.md) to drop such output that cause data conversion errors and proceed to the next one. The most common schema mismatch reasons are described below.
77
+
It's important to ensure that the output of your Stream Analytics job matches the column names and data types expected by your SQL Database table. If there's a mismatch, your job will run into data conversion errors, and continuously retry until the SQL table definition is changed. You can [change your job’s behavior](stream-analytics-output-error-policy.md) to drop such output that cause data conversion errors and proceed to the next one. The most common schema mismatch reasons are described below.
78
78
79
-
***Type mismatch**: The query and target types are not compatible. Rows will not be inserted in the destination. Use a [conversion function](/stream-analytics-query/data-types-azure-stream-analytics) such as TRY_CAST() to align types in the query. The alternate option is to alter the destination table in your SQL database.
79
+
***Type mismatch**: The query and target types aren't compatible. Rows won't be inserted in the destination. Use a [conversion function](/stream-analytics-query/data-types-azure-stream-analytics) such as TRY_CAST() to align types in the query. The alternate option is to alter the destination table in your SQL database.
80
80
***Range**: The target type range is considerably smaller than the one used in the query. Rows with out-of-range values [may not be inserted](/stream-analytics-query/data-types-azure-stream-analytics) in the destination table, or truncated. Consider altering the destination column to a larger type range.
81
81
***Implicit**: The query and target types are different but compatible. The data will be implicitly converted, but this could result in data loss or failures. Use a [conversion function](/stream-analytics-query/data-types-azure-stream-analytics) such as TRY_CAST() to align types in the query, or alter the destination table.
82
-
***Record**: This type is not yet supported for this output. The value will be replaced by the string ‘record’. Consider [parsing](/stream-analytics-query/stream-analytics-parsing-json.md) the data, or using an UDF to [convert to string](/stream-analytics-query/stream-analytics-javascript-user-defined-functions.md).
83
-
***Array**: This type is not yet supported natively supported in Azure SQL Database. The value will be replaced by the string ‘record’. Consider [parsing](/stream-analytics-query/stream-analytics-parsing-json.md) the data, or using an UDF to [convert to string](/stream-analytics-query/stream-analytics-javascript-user-defined-functions.md).
84
-
***Column missing from destination table**: This column is missing from the destination table. The data will not be inserted. Add this column to your destination table if needed.
82
+
***Record**: This type isn't yet supported for this output. The value will be replaced by the string ‘record’. Consider [parsing](/stream-analytics-query/stream-analytics-parsing-json.md) the data, or using an UDF to [convert to string](/stream-analytics-query/stream-analytics-javascript-user-defined-functions.md).
83
+
***Array**: This type isn't yet supported natively in Azure SQL Database. The value will be replaced by the string ‘record’. Consider [parsing](/stream-analytics-query/stream-analytics-parsing-json.md) the data, or using an UDF to [convert to string](/stream-analytics-query/stream-analytics-javascript-user-defined-functions.md).
84
+
***Column missing from destination table**: This column is missing from the destination table. The data won't be inserted. Add this column to your destination table if needed.
0 commit comments