文件差异如图:
更新语句如下:
GO ALTER TABLE [bsp_gifts] ADD [pid] [int] GO UPDATE [bsp_gifts] SET [pid]=0 --请更改为你商品库里有的ID即可 GO ALTER TABLE [bsp_gifts] ALTER COLUMN [pid] [int] NOT NULL GO CREATE NONCLUSTERED INDEX [pid] ON [bsp_gifts] ( [pid] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_gifts', @level2type=N'COLUMN',@level2name=N'pid'