Skip to content

Commit f349eab

Browse files
committed
Improved Acrolinx, added clarity, corrected grammar
1 parent 077c866 commit f349eab

File tree

2 files changed

+50
-30
lines changed

2 files changed

+50
-30
lines changed
Lines changed: 50 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: Connect to SQL Server from Power Apps
3-
description: Step-by-step instructions for how to connect to Azure SQL or an on-premises SQL Server database
3+
description: Learn how to connect to Azure SQL or an on-premises SQL Server database.
44
author: lancedMicrosoft
55

66
ms.topic: reference
77
ms.custom: canvas
8-
ms.date: 01/05/2024
8+
ms.date: 2/28/2024
99
ms.subservice: canvas-maker
1010
ms.author: lanced
1111
ms.reviewer: mkaur
@@ -15,66 +15,86 @@ contributors:
1515
- mduelae
1616
- lancedmicrosoft
1717
---
18+
1819
# Connect to SQL Server from Power Apps
1920

20-
Connect to SQL Server, in either Azure or an on-premises database.
21+
You can connect to SQL Server in either Azure or an on-premises database.
2122

2223
> [!NOTE]
23-
> Newly created SQL data sources are no longer prefixed with "[dbo]" as they have been in previous versions of Power Apps. For more information, see the [common issues and resolutions](/troubleshoot/power-platform/power-apps/common-issues-and-resolutions) page.
24+
> Newly created SQL data sources are no longer prefixed with `[dbo]` like in previous versions of Power Apps.
25+
>
26+
> For more information, see [Common issues and resolutions for Power Apps](/troubleshoot/power-platform/power-apps/common-issues-and-resolutions).
2427
2528
## Generate an app automatically
2629

27-
Depending upon whether you have the [new look](../intro-maker-portal.md?tabs=home-new-look) or [classic look](../intro-maker-portal.md?tabs=home-classic) turned on, select the appropriate tab to know more.
30+
Depending on which Power Apps interface you're using, reference the [new look](../intro-maker-portal.md?tabs=home-new-look) or the [classic look](../intro-maker-portal.md?tabs=home-classic) to build an app.
2831

2932
1. Sign in to [Power Apps](https://make.powerapps.com?utm_source=padocs&utm_medium=linkinadoc&utm_campaign=referralsfromdoc).
30-
2. Depending on how you want to create your app, from the home screen, select one of the following options:
33+
1. From the **Home** page, select either the _single-page gallery_ or _three screen mobile_ option:
3134
- To create a single-page gallery app with a responsive layout, choose either:
32-
- **Start with data** > **Connect to external data** > **From SQL**.
33-
- **Start with a page design** > **Gallery connected to external table** > **From SQL**.
35+
- **Start with data** > **Select external data** > **From SQL**.
36+
- **Start with a page design** > **Gallery connected to external data** > **From SQL**.
3437
- To create a three screen mobile app, select **Start with an app template** > **From SQL**.
35-
3. Select your SQL connection and then select a table. Note, that only one connection is shown at a time. To select a different connection, select on the **...** button to switch connection or create a new SQL connection.
36-
4. When you're done, select **Create app**.
38+
1. Select your SQL connection and then select a table. To choose a different connection, select the **...** overflow menu to switch your connection or create a new SQL connection.
39+
40+
> [!NOTE]
41+
> Only one connection is shown at a time.
42+
1. When you're done, select **Create app**.
43+
44+
## Call stored procedures directly in Power Fx (preview)
45+
46+
You can directly call SQL Server stored procedures from Power Fx by turning on the SQL Server stored procedure preview switch.
47+
48+
1. Go to **Settings** > **Upcoming features** > **Preview**.
49+
1. Search for _stored procedures_.
50+
1. Turn on the preview switch as shown.
3751

38-
## Call stored procedures directly in Power Fx (Preview)
39-
You can directly call SQL Server stored procedures from Power Fx. First you must turn on the SQL Server stored procedure preview switch. Navigate to Settings > Upcoming features > Preview. Search for "stored procedures" and turn on the preview switch as show in the image.
52+
:::image type="content" source="media/connection-azure-sqldatabase/previewflag-call-sp-direct.png" alt-text="Screenshot that shows the SQL Server stored procedures toggle set to On.":::
4053

41-
![Preview flag to enable direct calls of stored procedures.](media/connection-azure-sqldatabase/previewflag-call-sp-direct.png "Preview flag to enable direct calls of stored procedures")
54+
When you add a SQL Server connection to your app, you can now add tables and views or stored procedures.
4255

43-
With this feature turned you have the ability to add table, views, and stored procedures to your application. When you add a SQL Server connection to your app, you're presented a list of tables and views and also a list of stored procedures.
56+
:::image type="content" source="media/connection-azure-sqldatabase/tables-views-stored-proc-selector.png" alt-text="Screenshot that shows lists of tables, views, and stored procedures available to be added to your app.":::
4457

45-
![Selecting tables, views, and stored procedures.](media/connection-azure-sqldatabase/tables-views-stored-proc-selector.png "Selecting tables, views, and stored procedures")
58+
If you don't immediately see your stored procedure, it's faster to search for it.
4659

47-
If you don't immediately see your stored procedure, it's faster to search for it. Notice that once you select a stored procedure a child node appears and you have the ability to designate the stored procedure as **Safe to use for galleries and tables**. If you check this option, you can assign your stored procedure as an Items property for galleries for tables. Only enable this option if:
60+
Once you select a stored procedure, a child node appears and you can designate the stored procedure as **Safe to use for galleries and tables**. If you check this option, you can assign your stored procedure as an **Items** property for galleries for tables to use in your app.
4861

49-
1. There are no side effects to calling this procedure on demand, multiple times, whenever Power Apps decides it needs to refresh the control. When used with an Items property of a gallery or table, Power Apps calls the stored procedure whenever the system determines a refresh is needed. You can't control when it's called.
50-
2. The stored procedure returns less than the delegable limit (500/2000) of records. When a table or view is assigned to an Items property, Power Apps can control the paging and bring in 100 records at a time when it needs it. Stored procedures aren't pageable in the same way. They may be pageable via an argument to the stored procedure but you, as the author, are responsible for ensuring such behavior. Power Apps can't do this automatically like it can for tables and views.
62+
Enable this option only if:
63+
64+
1. There are no side effects to calling this procedure on demand, multiple times, whenever Power Apps refreshes the control. When used with an **Items** property of a gallery or table, Power Apps calls the stored procedure whenever the system determines a refresh is needed. You can't control when the stored procedure is called.
65+
2. The stored procedure returns less than the delegable limit (500/2000) of records. When a table or view is assigned to an **Items** property, Power Apps can control the paging and bring in 100 records at a time, when it needs it. Stored procedures are different and might be pageable through an argument to the stored procedure. But Power Apps can't bring in pages automatically like it can for tables and views. The author must configure pageability.
5166

5267
### Example
53-
When you add a stored procedure, you may see more than one data source in your project.
5468

55-
![Sql data sources.](media/connection-azure-sqldatabase/sqlserver-datasources.png "Sql data sources.")
69+
When you add a stored procedure, you might see more than one data source in your project.
70+
71+
:::image type="content" source="media/connection-azure-sqldatabase/sqlserver-datasources.png" alt-text=Screenshot that shows SQL data sources.":::
72+
73+
Prefix the stored procedure name with the name of connector associated with it. For example, _DataCardValue3_1.Text_ is from the _DataCard_ connector.
5674

57-
* Access the stored procedure by prefixing the stored procedure name with the name of connector associated with it. Be sure to cast the values (e.g., to a number) as necessary as you a reading from a text value in Power Apps.
75+
Label the values, for example using a number, as necessary since you're reading from a text value in Power Apps.
5876

5977
![Calling stored procedures directly.](media/connection-azure-sqldatabase/calling-sp-directly.png "Calling stored procedures directly.")
6078

61-
* To use a stored procedure in an Item property for a gallery or table simply use the stored procedure name in the same place where you would a table name.
79+
> [!TIP]
80+
> To use a stored procedure in an **Item** property for a gallery or table, use the stored procedure name where you'd use the table name.
6281
6382
## Known issues
6483

65-
### SQL data sources no longer adds a "[dbo]" prefix to the data source name
84+
### SQL data sources no longer add a `[dbo]` prefix to the data source name
6685

67-
The "[dbo]" prefix doesn't serve any practical purpose in Power Apps as data source names are automatically disambiguated. Existing data sources aren't affected, but any newly added SQL data sources won't include the prefix. If you need to update a large number of formulas in one of your apps, the [Power Apps Source File Pack and Unpack Utility](https://powerapps.microsoft.com/blog/source-code-files-for-canvas-apps/) can be used to do a global search-and-replace.
68-
69-
Starting in version 3.21054, we'll automatically update broken legacy name references to the new data source name after reading the data source.
86+
The `[dbo]` prefix doesn't serve any practical purpose in Power Apps as data source names are automatically disambiguated. Existing data sources aren't affected by this change, but any newly added SQL data sources don't include the prefix.
7087

88+
If you need to update a large number of formulas in one of your apps, the [Power Apps Source File Pack and Unpack Utility](https://powerapps.microsoft.com/blog/source-code-files-for-canvas-apps/) can be used to do a global search-and-replace.
7189

90+
> [!NOTE]
91+
> Starting in version 3.21054, we'll automatically update broken legacy name references to the new data source name after reading the data source.
7292
7393
## Next steps
7494

75-
* Learn how to [show data from a data source](../add-gallery.md).
76-
* Learn how to [view details and create or update records](../add-form.md).
77-
* See other types of [data sources](../connections-list.md) to which you can connect.
78-
* [Understand tables and records](../working-with-tables.md) with tabular data sources.
95+
- Learn how to [show data from a data source](../add-gallery.md).
96+
- Learn how to [view details and create or update records](../add-form.md).
97+
- See other types of [data sources](../connections-list.md) to which you can connect.
98+
- [Understand tables and records](../working-with-tables.md) with tabular data sources.
7999

80100
[!INCLUDE[footer-include](../../../includes/footer-banner.md)]

0 commit comments

Comments
 (0)