1、日志错误提示
Microsoft OLE DB Driver for SQL Server: Unable to load msoledbsqlr.rll due to either missing file or version mismatch. The application cannot continue.
2、原因分析
This appears to be a common issue.
The advice you received about installing the latest OLE drivers is correct. However, even with the latest drivers installed the snapshot agent will still use the older version drivers that come with SQL Server 2019.
This has to do with the Path variable in your environment. Have a look at System Properties, Advanced System Settings, Environment Variables, System variables, Path.
Unless you have changed your defaults you will find %SystemRoot%\system32, %SystemRoot% at the top and C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\ further down.
What you will not find is a path reference to %SystemRoot%\SysWOW64\ and %SystemRoot%\SysWOW64\1033 which is where the latest OLE drivers get installed on 64 bit systems. The driver files are msoledbsql.dll and msoledbsqlr.rll
So, when the snapshot agent starts it will use the OLE driver files installed relative to its binary somewhere under the C:\Program Files\Microsoft SQL Server\ branch as it cannot find any others in the Path.
When you insert %SystemRoot%\SysWOW64\ and %SystemRoot%\SysWOW64\1033 into your system Path variable (make sure this is above any references to C:\Program Files\Microsoft SQL Server\...) and the restart your SQL Server instance you should find that your problem goes away.
3、解决方案
1>在环境变量中添加%SystemRoot%\SysWOW64\ 和%SystemRoot%\SysWOW64\1033两个变量,并且在sql server的所有变量之前。
2>重启电脑或者sql server服务。
转载自:https://social.msdn.microsoft.com/Forums/en-US/e2c23cda-9e78-4514-bae6-27c6d34767a4/sql-server-2019-snapshot-agent-error?forum=sqlreplication
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
2019-08-06 Python 日期和时间
2019-08-06 Python日志库logging总结-可能是目前为止将logging库总结的最好的一篇文章
2019-08-06 Python-文件读写及修改