SQL创建表索引语句



SQL创建表索引语句:

   语法:

    use 数据库名
    go
    if exists(select name from sysindexes where name='索引名')
           drop  index  表名.索引名
    go
    create index 索引名 on 表名(字段名)
    go

    示例:

   use XC_RFIDTEST
   go

    --1、日志记录表:T_Bim_Fault
   if exists(select name from sysindexes where name='IX_FaultBatch')
          drop index T_Bim_Fault.IX_FaultBatch
   go
   create index IX_FaultBatch on T_Bim_Fault(Fault_Batch)
   go

你可能感兴趣的:(SQL,Server)