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]
精彩评论