Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.
The default constraint does not have any name.
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'tAccounting' AND COLUMN_NAME = 'CreatedDtm' AND DATA_TYPE = 'datetimeoffset') ALTER TABLE [dbo].[tAccounting] ADD [CreatedDtm] [datetimeoffset] (2) NOT NULL DEFAULT (GETDATE())
GO IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE PARENT_OBJ = OBJECT_ID(N'tAccountingDtl') AND NAME = 'DF_tAccountingDtl_CreatedDtm' AND type = 'D') ALTER TABLE [dbo].[tAccountingDtl] ADD CONSTRAINT [DF_tAccountingDtl_CreatedDtm] DEFAULT (getutcdate()) FOR [CreatedDtm] GO
Join the community of 500,000 technology professionals and ask your questions.