I make a table with Default values and that works fine :CREATE TABLE [TestDefault]( [ID] [int] NOT NULL, [aInt] [int] NOT NULL DEFAULT ((0)), [aTime] [datetime] NOT NULL DEFAULT (getdate()), [aBit] [bit] NULL DEFAULT ((0)), CONSTRAINT [PK_Logging.NotificationLog] 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]GOBut when I use "Script Table as" / Create To / New query Window then I get this :USE [DB]GO/****** Object: Table [dbo].[TestDefault] Script Date: 21-5-2015 14:54:30 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE TABLE [dbo].[TestDefault]( [ID] [int] NOT NULL, [aInt] [int] NOT NULL, [aTime] [datetime] NOT NULL, [aBit] [bit] NULL, CONSTRAINT [PK_Logging.NotificationLog] 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]GOALTER TABLE [dbo].[TestDefault] ADD DEFAULT ((0)) FOR [aInt]GOALTER TABLE [dbo].[TestDefault] ADD DEFAULT (getdate()) FOR [aTime]GOALTER TABLE [dbo].[TestDefault] ADD DEFAULT ((0)) FOR [aBit]GO How do I get my original Defaults on the line of the ColumnNames ?
↧