--更改表脚本
--添加列
Alter table PrintOrder Add PO_CreateDate datetime null default(getdate())
--更改列
Alter table PrintOrder Alter column PO_CreateDate datetime null
--更改默认值
ALTER TABLE [dbo].[PrintOrder] ADD CONSTRAINT [DF_PrintOrder_PO_CreateDate] DEFAULT (getdate()) FOR [PO_CreateDate]
--添加聚集主键
ALTER TABLE [dbo].[PrintOrder] ADD CONSTRAINT [PrintOrder_PK] PRIMARY KEY CLUSTERED
(
[PO_ID] ASC
)
--添加非聚集主键
ALTER TABLE [dbo].[PrintOrder] ADD CONSTRAINT [PrintOrder_PK] PRIMARY KEY NONCLUSTERED
(
[PO_ID] ASC
)
--添加唯一,聚集索引
CREATE UNIQUE CLUSTERED INDEX [IX_PNo_PTDStart] ON [dbo].[Payment]
(
[Policy_No] ASC,
[PTD_Start] ASC
)
--添加唯一,非聚集索引
CREATE UNIQUE NONCLUSTERED INDEX [IX_PNo_PTDStart] ON [dbo].[Payment]
(
[Policy_No] ASC,
[PTD_Start] ASC
)
--添加不唯一,非聚集索引
CREATE NONCLUSTERED INDEX [IX_PNo_PTDStart] ON [dbo].[Payment]
(
[Policy_No] ASC,
[PTD_Start] ASC
)
--添加不唯一,聚集索引
CREATE CLUSTERED INDEX [IX_PNo_PTDStart] ON [dbo].[Payment]
(
[Policy_No] ASC,
[PTD_Start] ASC
)
--更改存储过程脚本
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SP_Generate_HLJ]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[SP_Generate_HLJ]
GO
CREATE PROCEDURE [dbo].[SP_Generate_HLJ](
@poid int
)
AS
BEGIN
...
END