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'

  • 相关阅读:
    java8
    Python isinstance()
    Python3 File next()
    np.array() 与 np.mat() 比较
    np.nonzero()
    np.dot()
    算法之归并排序的应用 —— 小和问题以及逆序对问题
    递归过程以及递归master公式
    算法之异或运算及其应用
    算法之二分法及其应用
  • 原文地址:https://www.cnblogs.com/binbinxiong/p/3271835.html
Copyright © 2011-2022 走看看