摘要:
1 useAdventureWorks2 select id,object_name(id) as tableName,indid,rows,rowcnt3 from sys.sysindexes where indid in(0,1) 阅读全文
摘要:
查询表内容SELECT 表名=case when a.colorder=1 then d.name else '' end,表说明=case when a.colorder=1 then isnull(f.value,'') else '' end,字段序号=a.colorder,字段名=a.name,标识=case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then '√'else '' end,主键=case when exists(SELECT 1 FROM sysobjects where xtype='PK' and name 阅读全文
摘要:
SQL 2005数据库压缩DUMP TRANSACTIONHB2004 WITH NO_LOG BACKUP LOG HB2004 WITH NO_LOG DBCC SHRINKDATABASE(HB2004) 点击执行!这样子数据库就操作成功了。 程序里面的方法: 压缩数据库日志 --1.清空日志 exec('DUMP TRANSACTION ['+@dbname+'] WITH NO_LOG') --2.截断事务日志: exec('BACKUP LOG ['+@dbname+'] WITH NO_LOG') --3.收缩数据库 阅读全文