开发者

MySQL CREATE statement in MSSQL : the KEY keyword?

I have SQL CREATE statements for MySQL. They have KEY.

Example :

CREATE TABLE a (
  a varchar(25) NOT NU开发者_运维知识库LL DEFAULT '',
  b varchar(20) NOT NULL DEFAULT '',
  KEY location (a)
);

What is the CREATE statement for this table in MSSQL ? The KEY keyword does cause problem.


CREATE TABLE database1.dbo.a (
  a nvarchar(25),
  b nvarchar(25),
)
GO

CREATE INDEX a_index
  ON database1.dbo.a(a)
GO

...change db and schema names


if key is the column name, you could use square brackets to surround it..and then run the sql statement, like this: [KEY]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜