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: azure-sql/database/connect-query-go.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Use Go to create a program that connects to a database in Azure SQL
5
5
author: dlevy-msft
6
6
ms.author: dlevy
7
7
ms.reviewer: wiassaf, mathoma
8
-
ms.date: 07/26/2023
8
+
ms.date: 08/22/2023
9
9
ms.service: sql-database
10
10
ms.subservice: connect
11
11
ms.topic: quickstart
@@ -59,21 +59,14 @@ Get the connection information you need to connect to the database. You'll need
59
59
> [!NOTE]
60
60
> For connection information for SQL Server on Azure VM, see [Connect to a SQL Server instance](../virtual-machines/windows/sql-vm-create-portal-quickstart.md#connect-to-sql-server).
61
61
62
-
## Create Golang project and dependencies
62
+
## Create a new folder for the Golang project and dependencies
63
63
64
64
1. From the terminal, create a new project folder called **SqlServerSample**.
65
65
66
66
```bash
67
67
mkdir SqlServerSample
68
68
```
69
69
70
-
2. Navigate to **SqlServerSample** and install the SQL Server driver for Go.
71
-
72
-
```bash
73
-
cd SqlServerSample
74
-
go get github.com/microsoft/go-mssqldb
75
-
```
76
-
77
70
## Create sample data
78
71
79
72
1. In a text editor, create a file called **CreateTestData.sql** in the **SqlServerSample** folder. In the file, paste this T-SQL code, which creates a schema, table, and inserts a few rows.
@@ -306,15 +299,23 @@ Get the connection information you need to connect to the database. You'll need
306
299
}
307
300
```
308
301
309
-
## Run the code
302
+
## Get Golang project dependencies and run the code
303
+
304
+
1. At the command prompt, navigate to **SqlServerSample** and install the SQL Server driver for Go by running the following commands.
305
+
306
+
```bash
307
+
cd SqlServerSample
308
+
go mod init SqlServerSample
309
+
go mod tidy
310
+
```
310
311
311
-
1. At the command prompt, run the following command.
312
+
2. At the command prompt, run the following command.
Copy file name to clipboardExpand all lines: azure-sql/database/recovery-using-backups.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn about point-in-time restore, which enables you to roll back a
5
5
author: SudhirRaparla
6
6
ms.author: nvraparl
7
7
ms.reviewer: wiassaf, mathoma, danil
8
-
ms.date: 07/20/2022
8
+
ms.date: 08/21/2023
9
9
ms.service: sql-database
10
10
ms.subservice: backup-restore
11
11
ms.topic: how-to
@@ -96,7 +96,7 @@ You generally restore a database to an earlier point for recovery purposes. You
96
96
97
97
If you plan to retrieve data from the restored database to recover from a user or application error, you need to write and run a data recovery script that extracts data from the restored database and applies to the original database. Although the restore operation might take a long time to complete, the restoring database is visible in the database list throughout the restore process.
98
98
99
-
If you delete the database during the restore, the restore operation will be canceled. You won't be charged for the database that did not complete the restore.
99
+
If you delete the database during the restore, the restore operation will be canceled. You won't be charged for the database that didn't complete the restore.
100
100
101
101
### [Azure portal](#tab/azure-portal)
102
102
@@ -138,7 +138,7 @@ To restore a database by using the REST API:
138
138
139
139
## Long-term backup restore
140
140
141
-
To perform a restore operation on a long-term backup, you can use the Azure portal, the Azure CLI, Azure PowerShell, or the REST API. For more information, see [Restore a long-term backup](long-term-backup-retention-configure.md#view-backups-and-restore-from-a-backup). Long-term retention is not applicable to Hyperscale databases.
141
+
To perform a restore operation on a long-term backup, you can use the Azure portal, the Azure CLI, Azure PowerShell, or the REST API. For more information, see [Restore a long-term backup](long-term-backup-retention-configure.md#view-backups-and-restore-from-a-backup). Long-term retention isn't applicable to Hyperscale databases.
142
142
143
143
### [Azure portal](#tab/azure-portal)
144
144
@@ -283,7 +283,7 @@ For more information on using geo-restore, see [Recovery using Geo-restore](reco
283
283
> [!NOTE]
284
284
> For detailed information about recover from an outage, see [Azure SQL Database disaster recovery guidance](disaster-recovery-guidance.md) and the [Azure SQL Database high availability and disaster recovery checklist](high-availability-disaster-recovery-checklist.md).
285
285
286
-
Geo-restore is the most basic disaster-recovery solution available in SQL Database. It relies on automatically created geo-replicated backups with a recovery point objective (RPO) of up to 1 hour and an estimated recovery time objective (RTO) of up to 12 hours. It doesn't guarantee that the target region will have the capacity to restore your databases after a regional outage, because a sharp increase of demand is likely. If your application uses relatively small databases and is not critical to the business, geo-restore is an appropriate disaster-recovery solution.
286
+
Geo-restore is the most basic disaster-recovery solution available in SQL Database. It relies on automatically created geo-replicated backups with a recovery point objective (RPO) of up to 1 hour and an estimated recovery time objective (RTO) of up to 12 hours. It doesn't guarantee that the target region will have the capacity to restore your databases after a regional outage, because a sharp increase of demand is likely. If your application uses relatively small databases and isn't critical to the business, geo-restore is an appropriate disaster-recovery solution.
287
287
288
288
For business-critical applications that require large databases and must ensure business continuity, use [auto-failover groups](auto-failover-group-sql-db.md). That feature offers a much lower RPO and RTO, and the capacity is always guaranteed.
Copy file name to clipboardExpand all lines: azure-sql/database/security-best-practice.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,7 +159,7 @@ Password-based authentication methods are a weaker form of authentication. Crede
159
159
**Best practices**
160
160
161
161
- Use single sign-on authentication using Windows credentials. Federate the on-premises AD domain with Azure AD and use integrated Windows authentication (for domain-joined machines with Azure AD).
162
-
- See the article, [SSMS support for Azure AD Integrated authentication](authentication-aad-configure.md#active-directory-integrated-authentication).
162
+
- See the article, [SSMS support for Azure AD Integrated authentication](authentication-aad-configure.md#azure-active-directory---integrated).
163
163
164
164
### Minimize the use of password-based authentication for applications
Copy file name to clipboardExpand all lines: docs/database-engine/configure-windows/connect-to-sql-server-when-system-administrators-are-locked-out.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: "Connect to SQL Server when system administrators are locked out"
3
3
description: Learn how to regain access to SQL Server as a system administrator if you've been mistakenly locked out.
4
4
author: rwestMSFT
5
5
ms.author: randolphwest
6
-
ms.date: 07/14/2022
6
+
ms.date: 08/21/2023
7
7
ms.service: sql
8
8
ms.subservice: configuration
9
9
ms.topic: conceptual
@@ -25,15 +25,15 @@ This article describes how you can regain access to the [!INCLUDE[ssDEnoversion]
25
25
26
26
- The logins that are members of the sysadmin fixed server role are for individuals who have left the company or who aren't available.
27
27
28
-
- The sa account is disabled or no one knows the password.
28
+
- The `sa` account is disabled or no one knows the password.
29
29
30
30
## Resolution
31
31
32
32
In order to resolve your access issue, we recommend that you start the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] in single-user mode. This mode prevents other connections from occurring while you try to regain access. From here, you can connect to your instance of SQL Server and add your login to the **sysadmin** server role. Detailed steps for this solution are provided in the [step-by-step-instructions](#step-by-step-instructions) section.
33
33
34
34
You can start an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] in single-user mode with either the `-m` or `-f` options from the command line. Any member of the computer's local Administrators group can then connect to the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] as a member of the **sysadmin** fixed server role.
35
35
36
-
When you start the instance in single-user mode, first stop the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Agent service. Otherwise, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Agent might connect first, taking the only available connection to the server and blocking you from logging in.
36
+
When you start the instance in single-user mode, stop the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Agent service. Otherwise, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Agent might connect first, taking the only available connection to the server and blocking you from logging in.
37
37
38
38
It's also possible for an unknown client application to take the only available connection before you're able to sign in. In order to prevent this from happening, you can use the `-m` option followed by an application name to limit connections to a single connection from the specified application. For example, starting [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] with `-mSQLCMD` limits connections to a single connection that identifies itself as the **sqlcmd** client program. To connect through the Query Editor in [!INCLUDE[ssManStudio](../../includes/ssmanstudio-md.md)], use `-m"Microsoft SQL Server Management Studio - Query"`.
39
39
@@ -55,10 +55,10 @@ For step-by-step instructions about how to start [!INCLUDE[ssNoVersion](../../in
55
55
56
56
### Use PowerShell
57
57
58
-
#### Option 1: Run the steps directly in an executable notebook via Azure Data Studio
58
+
#### Option 1: Run the steps directly in an executable notebook using Azure Data Studio
59
59
60
60
> [!NOTE]
61
-
> Before attempting to open this notebook, check that Azure Data Studio is installed on your local machine. To install, go to[Learn how to install Azure Data Studio](../../azure-data-studio/download-azure-data-studio.md).
61
+
> Before attempting to open this notebook, check that Azure Data Studio is installed on your local machine. To install Azure Data Studio, see[Learn how to install Azure Data Studio](../../azure-data-studio/download-azure-data-studio.md).
62
62
63
63
> [!div class="nextstepaction"]
64
64
> [Open Notebook in Azure Data Studio](azuredatastudio://microsoft.notebook/open?url=https://raw.githubusercontent.com/microsoft/mssql-support/master/sample-scripts/DOCs-to-Notebooks/T-shooting-SQL-SystemAdmins-Locked-out.ipynb)
@@ -108,7 +108,7 @@ For step-by-step instructions about how to start [!INCLUDE[ssNoVersion](../../in
108
108
> `Sqlcmd: Error: Microsoft ODBC Driver X for SQL Server : Login failed for user 'CONTOSO\BobD'. Reason: Server is in single user mode. Only one administrator can connect at this time..`
109
109
110
110
1.**Mixed Mode (optional):** If your SQL Server is running in mixed authentication mode, you can also:
111
-
1. Grant the Sysadmin role membership to a SQL login. Execute code such as the following to create a new SQL Server authentication login that is a member of the sysadmin fixed server role. Replace "?j8:z$G=JE9" with a strong password of your choice.
111
+
1. Grant the **sysadmin** role membership to a SQL login. Execute code such as the following to create a new SQL Server authentication login that is a member of the **sysadmin** fixed server role. Replace `?j8:z$G=JE9` with a strong password of your choice.
112
112
113
113
If you have a default instance, use the name of the server.
114
114
@@ -117,7 +117,7 @@ For step-by-step instructions about how to start [!INCLUDE[ssNoVersion](../../in
117
117
sqlcmd.exe -E -S $sql_server_instance -Q "CREATE LOGIN TempLogin WITH PASSWORD = '$strong_password'; ALTER SERVER ROLE sysadmin ADD MEMBER TempLogin; "
118
118
```
119
119
120
-
1. Also, if your SQL Server is running in mixed authentication mode and you want to reset the password of an enabled **sa** account. Change the password of the sa account with the following syntax. Be sure to replace "j8:zG=J?E9" with a strong password of your choice:
120
+
1. Also, if your SQL Server is running in mixed authentication mode and you want to reset the password of an enabled **sa** account. Change the password of the sa account with the following syntax. Be sure to replace `j8:zG=J?E9` with a strong password of your choice:
121
121
122
122
If you have a default instance, use the name of the server.
123
123
@@ -151,17 +151,17 @@ Perform these instructions while logged in to Windows as a member of the local a
151
151
152
152
1. On the **Startup Parameters** tab, in the **Specify a startup parameter** box, type `-m` and then select **Add**. (That's a dash then lower case letter m.)
153
153
154
-
For some earlier versions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] there is no **Startup Parameters** tab. In that case, on the **Advanced** tab, double-click **Startup Parameters**. The parameters open up in a small window. Be careful not to change any of the existing parameters. At the very end, add a new parameter `;-m` and then select **OK**. (That's a semi-colon then a dash then lower case letter m.)
154
+
For some earlier versions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], there's no **Startup Parameters** tab. In that case, on the **Advanced** tab, double-click **Startup Parameters**. The parameters open up in a small window. Be careful not to change any of the existing parameters. At the very end, add a new parameter `;-m` and then select **OK**. (That's a semi-colon then a dash then lower case letter m.)
155
155
156
156
1. Select **OK**, and after the message to restart, right-click your server name, and then select **Restart**.
157
157
158
158
1. After [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] has restarted, your server will be in single-user mode. Make sure that [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Agent isn't running. If started, it will take your only connection.
159
159
160
-
1. From the Windows Start menu, right-click the icon for [!INCLUDE[ssManStudio](../../includes/ssmanstudio-md.md)] and select **Run as administrator**. This will pass your administrator credentials to SSMS.
160
+
1. From the Windows Start menu, right-click the icon for [!INCLUDE[ssManStudio](../../includes/ssmanstudio-md.md)] and select **Run as administrator**. This passes your administrator credentials to SSMS.
161
161
162
162
For earlier versions of Windows, the **Run as administrator** option appears as a submenu.
163
163
164
-
In some configurations, SSMS will attempt to make several connections. Multiple connections will fail because [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is in single-user mode. Based on your scenario, perform one of the following actions.
164
+
In some configurations, SSMS attempts to make several connections. Multiple connections will fail because [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is in single-user mode. Based on your scenario, perform one of the following actions.
165
165
166
166
1. Connect with Object Explorer using Windows Authentication, which includes your Administrator credentials. Expand **Security**, expand **Logins**, and double-click your own login. On the **Server Roles** page, select **sysadmin**, and then select **OK**.
167
167
@@ -199,7 +199,7 @@ Perform these instructions while logged in to Windows as a member of the local a
199
199
200
200
1. On the **Startup Parameters** tab, in the **Existing parameters**box, select`-m`and then select**Remove**.
201
201
202
-
For some earlier versions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] there is no **Startup Parameters** tab. In that case, on the **Advanced** tab, double-click **Startup Parameters**. The parameters open up in a small window. Remove the `;-m` that you added earlier, and then select**OK**.
202
+
For some earlier versions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], there's no **Startup Parameters** tab. In that case, on the **Advanced** tab, double-click **Startup Parameters**. The parameters open up in a small window. Remove the `;-m` that you added earlier, and then select **OK**.
203
203
204
204
1. Right-click your server name, and then select **Restart**. Make sure to start [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Agent again if you stopped it before starting [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] in single-user mode.
0 commit comments