Wei_Guanghui
Wei_Guanghui
采纳率0%
2014-12-04 08:59 阅读 1.8k

这个sql语句什么意思?

CREATE TABLE [dbo].users NOT NULL,
[hashed_password] varchar NOT NULL,
[salt] varchar NOT NULL,
[lv] [smallint] NOT NULL,
[created_on] [datetime] NOT NULL DEFAULT(GETDATE()),
[created_platform] [smallint] NOT NULL,
[created_ip] varchar NOT NULL,
[last_login_on] [datetime] NULL,
[last_login_platform] [smallint] NULL,
[last_login_ip] varchar NULL,
[login_on] [datetime] NULL,
[login_platform] [smallint] NULL,
[login_ip] varchar NULL,
[status] [tinyint] NOT NULL,
CONSTRAINT [PK_users] PRIMARY KEY CLUSTERED
(
[id] 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

CONSTRAINT [PK_users] PRIMARY KEY CLUSTERED
(
[id] 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
这些不是很明白啊

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

8条回答 默认 最新

  • caozhy 从今以后生命中的每一秒都属于我爱的人 2014-12-04 09:09

    CREATE TABLE 创建了一个表,PK_users这里定义了一个主键,并且设置了排序规则和建立了索引。

    点赞 评论 复制链接分享
  • caozhy 从今以后生命中的每一秒都属于我爱的人 2014-12-04 09:11

    从字面上看
    CREATE TABLE [dbo].users NOT NULL, 用户表
    [hashed_password] varchar NOT NULL, 密码的Hash
    [salt] varchar NOT NULL, Hash的Salt
    [lv] [smallint] NOT NULL, 等级
    [created_on] [datetime] NOT NULL DEFAULT(GETDATE()), 创建时间
    [created_platform] [smallint] NOT NULL, 创建的平台
    [created_ip] varchar NOT NULL, 创建的ip
    [last_login_on] [datetime] NULL, 上次登录时间
    [last_login_platform] [smallint] NULL, 上次登录平台
    [last_login_ip] varchar NULL, 上次登录ip
    [login_on] [datetime] NULL, 登录时间
    [login_platform] [smallint] NULL, 登录平台
    [login_ip] varchar NULL, 登录ip
    [status] [tinyint] NOT NULL, 状态

    点赞 评论 复制链接分享
  • q107770540 兔子党-督察 2014-12-04 09:51

    这其实就是个创建数据库表的语句

    点赞 评论 复制链接分享
  • Wei_Guanghui Wei_Guanghui 2014-12-05 02:09

    CONSTRAINT [PK_users] PRIMARY KEY CLUSTERED
    (
    [id] 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
    字段我知道,就是这些不是很懂,第一次接触啊

    点赞 评论 复制链接分享
  • fredrickhu --小F-- 2014-12-05 03:10

    这个你直接去查联机丛书比较好。如果你运行的SSMS,直接按F1出来的帮助就可以了。你可以直接搜索不懂的部分。

    点赞 评论 复制链接分享
  • fredrickhu --小F-- 2014-12-05 03:16

    ON [PRIMARY] 表示这个表建立在 PRIMARY主数据组

    PAD_INDEX = OFF,
    STATISTICS_NORECOMPUTE = OFF,
    IGNORE_DUP_KEY = OFF,
    ALLOW_ROW_LOCKS = ON, 允许行锁
    ALLOW_PAGE_LOCKS = ON 允许页锁

    具体的介绍在这里

    点赞 评论 复制链接分享
  • fredrickhu --小F-- 2014-12-05 03:16
  • eagleyan Coursera 2014-12-06 07:18

    DML = Data Manipulation Language
    DDL = Data Definition Language
    猜猜这个是哪个?

    点赞 评论 复制链接分享

相关推荐