简体   繁体   English

ApplicationIntent=ReadOnly 与 SQL Server 导入和导出向导

[英]ApplicationIntent=ReadOnly with SQL Server Import and Export Wizard

I pull data down from an Azure based SQL Server every now and then using the SQL Server Import and Export Wizard (which I already know isn't the best way to go about that...in the queue to change but not for now).我时不时地从基于 Azure 的 SQL Server 中提取数据,然后使用 SQL Server 导入和导出向导(我已经知道这不是解决此问题的最佳方法……在更改队列中,但现在不是) . I was wondering if there is a way to add user ApplicationIntent=ReadOnly somehow like you would in a standard SQL Server Connection string so I hit one of the read only secondary databases instead of the high trafficked main one.我想知道是否有一种方法可以像在标准 SQL Server 连接字符串中那样添加用户ApplicationIntent=ReadOnly ,所以我点击了一个只读辅助数据库,而不是高流量的主数据库。 I'm going to go ahead with no there is not you are doing it wrong but I thought I'd ask first.我会继续前进,没有你做错了,但我想我会先问。

Thanks.谢谢。

Don't beat yourself up for using the Import/Export Wizard - for quick and dirty /one-off ETL work, it's a great tool.不要因为使用导入/导出向导而自责 - 对于快速而肮脏的/一次性 ETL 工作,它是一个很棒的工具。 Under the hood, it uses SSIS.在引擎盖下,它使用 SSIS。 But by design it is a wizard and so is not going to give you all of the knobs to turn.但从设计上讲,它是一个向导,所以不会给你所有的旋钮来转动。

But all is not lost!但一切都没有丢失! To answer your question about using read-only application intent, at the point right before you'd actually run the ETL through the wizard, it gives you the option to save the SSIS package rather than run it.为了回答您关于使用只读应用程序意图的问题,在您通过向导实际运行 ETL 之前,它为您提供了保存 SSIS 包而不是运行它的选项。 Save it off and then you have the option of changing the connection however you'd like.将其保存下来,然后您可以选择根据需要更改连接。 This Q/A over on the DBA sibling site shows you how to get a read-only connection in SSIS. DBA 兄弟站点上的这个Q/A 向您展示了如何在 SSIS 中获取只读连接。

If that all seems roundabout, the suggestion from @Stu in the comment above of just determining the name of the secondary replica and using that is a great one given the one-off nature of Import/Export Wizard work.如果这一切看起来都是迂回的,那么考虑到导入/导出向导工作的一次性性质,上面评论中@Stu 的建议只是确定辅助副本的名称并使用它是一个很好的建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM