What are the challenges you face when working across database platforms? Take the survey
Options

current_timestamp table default getting brought in as a function

When adding a new SQL table from a flat file, i've got the table defined like this:

CREATE TABLE [dbo].[Redgate]
(
[umEquipmentID] [VARCHAR] (30) COLLATE Latin1_General_CI_AS NOT NULL,
[new_umEquipment] [float] NOT NULL,
[old_umEquipment] [float] NOT NULL,
[userid] [VARCHAR] (30) COLLATE Latin1_General_CI_AS NOT NULL,
[tstamp] [DATETIME] NULL CONSTRAINT [DF__UM00400Au__tstam__1990D406] DEFAULT (current_timestamp)
)

When this gets pulled in to SQL Compare 13, it puts a () after current_timestamp, which then blows up the deployment script because SQL kicks that back out as Incorrect syntax.

From SQL Compare:

CREATE TABLE [dbo].[Redgate]
(
[umEquipmentID] [VARCHAR] (30) COLLATE Latin1_General_CI_AS NOT NULL,
[new_umEquipment] [float] NOT NULL,
[old_umEquipment] [float] NOT NULL,
[userid] [VARCHAR] (30) COLLATE Latin1_General_CI_AS NOT NULL,
[tstamp] [DATETIME] NULL CONSTRAINT [DF__UM00400Au__tstam__1990D406] DEFAULT (current_timestamp())
)
Tagged:

Answers

Sign In or Register to comment.