******************************作业备份执行语句
declare @name varchar(250)
set @name='D:\lizhongwa\leadyoo'+
convert(varchar(50),getdate(),112)+'.bak'
BACKUP DATABASE [MisFrameWork] TO
DISK = @name
WITH NOFORMAT, NOINIT,
NAME = N'[MisFrameWork]',
SKIP, NOREWIND, NOUNLOAD
******************************查找索引信息
SELECT 索引名称=a.name
,表名=c.name
,索引字段名=d.name
,索引字段位置=d.colid
FROM sysindexes a
JOIN sysindexkeys b ON a.id=b.id AND a.indid=b.indid
JOIN sysobjects c ON b.id=c.id
JOIN syscolumns d ON b.id=d.id AND b.colid=d.colid
WHERE a.indid NOT IN(0,255)
-- and c.xtype='U' and c.status>0 --查所有用户表
AND c.name='表名' --查指定表