zoukankan      html  css  js  c++  java
  • sql语句

    在SQL里,我们常用到复制表来完成一些功能。
     
    SQL复制表的几种方法:
     
    SQL复制整张表
    select * into NewTableName from OldTableName
     
    复制列名而不要内容
    select * into NewTableName from OldTableName where 1=0
     
    表间数据复制
    insert into Table1(zt) select titile from Table2
     
    ==========================

    用SQL语句更改自动编号的字段重新从'1'开始编号

    tableName(id,clcode,cloth) id字段为identity(int,1,1) 重建id
    select * into #aa from tableName
    truncate table tableName
    dbcc checkident(tableName,reseed,0)
    set IDENTITY_INSERT ON
    insert tableName(clcode,clname) select clcode,clname from #aa
    //注意不能选择id列
    drop table #aa
    ==========================

    SQL 数据库 'tempdb' 的日志已满的解决办法 ---SQL解决代码方法

    use tempdb

    select * from tempdb.dbo.sysfiles

    dump transaction tempdb with no_log

    dbcc shrinkfile ('templog',1)

    select * from tempdb.dbo.sysfiles

  • 相关阅读:
    android 图表
    android assets 文件路径,与文件是否存在
    WebKit 与Chromium
    android footerView 的使用
    android gif
    webkit 介绍
    java 内存优化2
    jive论坛
    ajax josn
    jsp 数据饼图
  • 原文地址:https://www.cnblogs.com/qima/p/2672116.html
Copyright © 2011-2022 走看看