sql-server – ApplicationIntent = ReadOnly是什么意思在连接字符串中

我正在使用MS Access通过DSN连接连接到sql Server.这是与sql server后端的链接表.这是连接字符串
ODBC;DSN=mydsn;Description=mydesc;Trusted_Connection=Yes;APP=Microsoft Office 2010;DATABASE=mydb;ApplicationIntent=READONLY;;TABLE=dbo.mytable

您可以看到连接字符串中有一个ApplicationIntent = READONLY标签.这是什么意思.我以只读方式连接到数据库吗?是否建议使用此连接字符串执行更新和插入?

解决方法

这意味着如果您在sql Server 2012中使用可用性组,则引擎知道您的连接是只读的,并且可以路由到只读副本(如果存在).一些信息在这里

Configure Read-Only Access on an Availability Replica

Availability Group Listeners,Client Connectivity,and Application Failover

如果您当前没有使用可用性组,那么将其放在前端兼容性可能是个好主意,但这取决于您是否有意仅仅阅读.这应该防止写入,但有一些注意事项.这些连接的项目可能是有用的或可能会让你刮伤你的头.我承认我没有读过他们.

ApplicationIntent=ReadOnly allows updates to a database

ApplicationIntent=ReadOnly does not send the connection to the secondary copy

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...