SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE skyPortletLink(
[Id] [int] IDENTITY(1,1) NOT NULL,
[Title] [nvarchar](500) NULL,
[URL] [nvarchar](500) NULL,
[DataSources] [varchar](1000) NULL,
[Xtype] [int] NULL,
[Xorder] [int] NULL,
[HiddenCondition] [varchar](500) NULL,
[IsPop] [bit] NULL,
CONSTRAINT [PK_skyPortalItemLink] 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
SET ANSI_PADDING OFF
GO
ALTER TABLE skyPortletLink ADD CONSTRAINT [DF_skyPortalItemLink_IsPop] DEFAULT ((0)) FOR [IsPop]
GO
上面的SQL语句如何简化一下,看着太晕了。
这不是一个就是建了一个表么
ALTER TABLE skyPortletLink ADD CONSTRAINT [DF_skyPortalItemLink_IsPop] DEFAULT ((0)) FOR [IsPop] 这句话什么意思,怎么把这句话简化一下?谢谢……
@清明雨上:
这句可以不要,在[IsPop] [bit] NULL后面加DEFAULT (0)就是了
其实就create 一个表。设置一个主键
CREATE TABLE ---
add ---
呵呵,楼主这段代码是根据现有表自动生成的吧。如果要简化的话就这样写:
CREATE TABLE skyPortletLink(
[Id] [int] IDENTITY(1,1) NOT NULL,
[Title] [nvarchar](500) NULL,
[URL] [nvarchar](500) NULL,
[DataSources] [varchar](1000) NULL,
[Xtype] [int] NULL,
[Xorder] [int] NULL,
[HiddenCondition] [varchar](500) NULL,
[IsPop] [bit] NULL,
CONSTRAINT [PK_skyPortalItemLink] PRIMARY KEY CLUSTERED)
要简写的话,是写论文用吗?