string tatlename = "T_useruid";//定义一个变量。用于自动创建数据表的名称,当前表名为:T_useruid
string sql = "CREATE TABLE [dbo].[" + tatlename + "]([Cid] [int] IDENTITY(1,1) NOT NULL,[Uid] [nchar](32) COLLATE Chinese_PRC_CI_AS NULL,CONSTRAINT [PK_" + tatlename + "] PRIMARY KEY CLUSTERED ([Cid] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]";
给这个数据表:T_useruid 的Uid字段增加一个索引
string sql = "CREATE UNIQUE INDEX PK_T_useruid_u ON T_useruid (Uid)";
分析SQL:CREATE UNIQUE INDEX 索引名称 ON 数据表名称 (字段名称)