zoukankan      html  css  js  c++  java
  • SQL备份表及相关笔记

    create table history1301
    (
     remark nvarchar(64)
    )
    create table history1302
    (
     remark nvarchar(64)
    )
    create table history1303
    (
     remark nvarchar(64)
    )
    create table history1304
    (
     remark nvarchar(64)
    )

    create table history
    (
     remark nvarchar(64)
    )

    insert into history1301(remark) values('history1301');
    insert into history1302(remark) values('history1302');
    insert into history1303(remark) values('history1303');
    insert into history1304(remark) values('history1304');

    select * from history1301;
    select * from history1302;
    select * from history1303;
    select * from history1304;
    select * from history
    --备份表
    select * into history1111 from history1301
    --插入历史记录

    --假如表存在(实用多表多次导入)
    insert into history(remark) (select remark from history1301)
    insert into history(remark) (select remark from history1302)
    insert into history(remark) (select remark from history1303)
    insert into history(remark) (select remark from history1304)

    --假如不存在(实用单表单次导入)
    select * into historyTemp from history1301

    --查看用户库中是否存在history表
    select * from sys.objects where [type]='U' and name='history'

    --查看是否有是否创建数据库实例
    select * from sys.sysdatabases  where name='数据库名'

    --查看表约束
    exec sp_helpconstraint 'history'

    exec sp_help 'Account'
    exec sp_helpconstraint 'Account'

  • 相关阅读:
    精细化python 类的内置属性
    python操作excel
    ghost linux
    Linux dd 命令
    Ubantu 使用root登陆的方法
    NSIS Error: "Error writing temporary file. Make sure your temp folder is valid
    error writing temporary file。make sure your temp folder is valid 问题已解决
    安卓电池状态监听
    Android源码下载
    vim插件详细安装过程
  • 原文地址:https://www.cnblogs.com/binbinxiong/p/3271835.html
Copyright © 2011-2022 走看看