使用SQL SERVER管理工作室查看表定义

时间:2014-06-10 09:02:39

标签: sql-server ssms

“脚本表为 - >创建为”的输出是什么意思?我有一个分区表,但是当我在Management Studio中右键单击它并选择“Script Table As - > CREATE To”时,输出中不包含任何与表分区相关的内容。我应该找到“ON partition_scheme_name”,但它没有出现。

USE [FcstDB]
GO

/****** Object:  Table [dbo].[StFcst]    Script Date: 2014-06-10 15:54:37 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[StFcst](
[MID] [tinyint] NOT NULL,
[INITDATE] [smalldatetime] NOT NULL,
[FH] [tinyint] NOT NULL,
[STID] [char](5) NOT NULL,
[WW03] [smallint] NOT NULL,
[WW06] [smallint] NOT NULL,
[WW12] [smallint] NOT NULL,
[T] [smallint] NOT NULL,
[TMAX12] [smallint] NOT NULL,
[TMIN12] [smallint] NOT NULL,
[PR03] [smallint] NOT NULL,
[PR06] [smallint] NOT NULL,
[PR12] [smallint] NOT NULL,
[PR24] [smallint] NOT NULL,
[RH] [smallint] NOT NULL,
[WD] [smallint] NOT NULL,
[WS] [smallint] NOT NULL,
[CLOUD] [smallint] NOT NULL,
[VV] [int] NOT NULL,
[SLP] [smallint] NOT NULL,
[E_T] [smallint] NOT NULL,
[E_TMAX12] [smallint] NOT NULL,
[E_TMIN12] [smallint] NOT NULL,
[E_PR03] [smallint] NOT NULL,
[E_PR06] [smallint] NOT NULL,
[E_PR12] [smallint] NOT NULL,
[E_PR24] [smallint] NOT NULL,
[E_WD] [smallint] NOT NULL,
[E_WS] [smallint] NOT NULL,
 CONSTRAINT [PK_StFcst] PRIMARY KEY CLUSTERED 
(
[INITDATE] DESC,
[FH] ASC,
[MID] ASC,
[STID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,       ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)

GO

1 个答案:

答案 0 :(得分:0)

Script Table As -> CREATE To创建包含Create command给定表结构的脚本,而不包含任何类型的数据。

您打算在其他地方复制数据吗?如果是,请考虑使用SELECT INTO命令。

对于创建分区方案,请访问msdn

脚本表文档here