0

我有以下 SQL Server 创建脚本。谁能帮我把它转换成 MySQL。

我不确定定义主键的位在做什么。

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE IF NOT EXISTS `webdb`.`UserSessions`(
UniqueID VARCHAR(50) NOT NULL,
UserID VARCHAR(255) NOT NULL,
TokenExpires DATETIME NOT NULL,
LastSeen DATETIME NOT NULL,
LoggedOut bit NOT NULL,
CONSTRAINT [PK_EndedSessions] PRIMARY KEY CLUSTERED 
(
UniqueID ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO 
4

1 回答 1

0
CREATE TABLE IF NOT EXISTS `webdb`.`UserSessions`
(
    UniqueID VARCHAR(50) NOT NULL PRIMARY KEY,
    UserID VARCHAR(255) NOT NULL,
    TokenExpires DATETIME NOT NULL,
    LastSeen DATETIME NOT NULL,
    LoggedOut bit NOT NULL
);
于 2012-08-02T08:21:42.757 回答