zoukankan      html  css  js  c++  java
  • 将一个数据库中的表复制到另一个数据库中,只需要复制一部分内容,两个数据库在同一服务器中!

    表不存在的情况下
    select 字段1,字段2.....字段n into 数据库名..新表名 from 旧数据库名..旧表 where 条件
    
    表存在的情况下
    insert into 数据库名..新表名 select select 字段1,字段2.....字段n from 旧数据库名..旧表 where 条件
    select * into 数据库.dbo.新表名  from  数据库.dbo.要复制的表



    select * into OA5..SL_AskedForLeaveType from OA..SL_AskedForLeaveType


    从另一个数据库表提供的数据,更新当前数据库表的一列
    update VocationalGuidance2..VGS_ResumeTemplate set TemplateContent=(select TemplateContent from [VGS_ResumeTemplate])

    select * from  labsubject where ISNUMERIC (textbookid )=1

    update labsubject set textbookid=(select bookname from yq_book where id=cast(textbookid as int)) where ISNUMERIC (textbookid )=1

  • 相关阅读:
    springboot 整合 memcached l
    文件处理工具类 l
    执行脚本工具类 l
    LRU l
    归并排序 l
    Redis 数据类型 l
    git 常用操作命令 唏嘘
    postmanPOST请求 status 415错误 唏嘘
    MySQL 启动和关闭MySQL服务 唏嘘
    OO和OP
  • 原文地址:https://www.cnblogs.com/slyzly/p/2769350.html
Copyright © 2011-2022 走看看