涉及两个不同目录的更新语句

发布于 2024-09-24 16:27:20 字数 229 浏览 0 评论 0原文

尝试执行当前数据库想要从昨晚的备份中提取值的单个字段的更新。应该是接近于:

update myTable 
   set status = (select status 
                   from .lastBackup.dbo.myTable as t 
                  where t.idField = idField)

帮助?

Trying to execute an update of a single field where the current db wants to pull values from last night's backup. Should be something close to:

update myTable 
   set status = (select status 
                   from .lastBackup.dbo.myTable as t 
                  where t.idField = idField)

Help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如何视而不见 2024-10-01 16:27:20

试试这个:

update t
    set status = b.status
    from myTable t
        inner join lastBackup.dbo.myTable b
            on t.idField = b.idField

Try this:

update t
    set status = b.status
    from myTable t
        inner join lastBackup.dbo.myTable b
            on t.idField = b.idField
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文