sp_helpindex @objname='ma_lot' --判断某表的索引是不是存在
IF EXISTS(SELECT * FROM SYSINDEXES WHERE name='test')PRINT 'cunzai'
DROP INDEX ma_lot.testGOELSE PRINT 'bucunzai'
--创建索引
CREATE CLUSTERED INDEX test ON dbo.mm(MName)