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

  • 相关阅读:
    mongoDB使用
    mac环境下mongodb的安装和使用
    statrc部分
    权限部分
    在Linux 安装Python3.5.6详细文档!!!!
    linux回顾
    linux服务配置
    路飞ORM练习
    考试题-路飞中期(卷一)
    git hub命令,上传到github
  • 原文地址:https://www.cnblogs.com/slyzly/p/2769350.html
Copyright © 2011-2022 走看看