从别人的数据转一张表,生产脚本,下边一段是什么啊? 我用的SQL2008 r2
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1=新闻,2=公告,3=作品,4=工作,5=动态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Articles', @level2type=N'COLUMN',@level2name=N'TypeId'
完整代码
GO
/****** Object: Table [dbo].[Articles] Script Date: 01/17/2013 13:41:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Articles](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Title] [nvarchar](200) NOT NULL,
[Content] [nvarchar](max) NULL,
[TypeId] [int] NOT NULL,
[PubDate] [smalldatetime] NOT NULL,
[TimesViewed] [int] NOT NULL,
[Author] [nvarchar](50) NULL,
[Display] [bit] NOT NULL,
[Department] [nvarchar](50) NULL,
[Source] [nvarchar](50) NULL,
[Subtitle] [nvarchar](200) NULL,
[TopImage] [nvarchar](120) NULL,
[Approved] [bit] NOT NULL,
[Moderator] [nvarchar](50) NULL,
CONSTRAINT [PK_Articles] 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
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1=新闻,2=公告,3=作品,4=工作,5=动态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Articles', @level2type=N'COLUMN',@level2name=N'TypeId'
GO
ALTER TABLE [dbo].[Articles] ADD CONSTRAINT [DF_Articles_TimesViewed] DEFAULT ((0)) FOR [TimesViewed]
GO
ALTER TABLE [dbo].[Articles] ADD CONSTRAINT [DF_Articles_Display] DEFAULT ((1)) FOR [Display]
GO
ALTER TABLE [dbo].[Articles] ADD CONSTRAINT [DF_Articles_Approved] DEFAULT ((0)) FOR [Approved]
GO
------解决方案--------------------
将新扩展属性添加到数据库对象中。
其实你可以认为就是一些对数据表的注释说明而已
------解决方案--------------------
这个你到联机丛书上输入sp_addextendedproperty就可以查到了
------解决方案--------------------
就是这里的这个说明内容
------解决方案--------------------
如果不抱错,还是建议保留,它是对表或者库的一个说明文档。当然不用也是可以的。
------解决方案--------------------
就是添加数据库对象的注释
通常生成的这个是给字段加的描述,也可以给表,库等对象加描述。
------解决方案--------------------