DROP TABLE "CMS_TEMP";
CREATE TABLE "CMS_TEMP" (
"ID" VARCHAR2(36) DEFAULT SYS_GUID() NOT NULL,
"NAME" NVARCHAR2(150),
"RCDATE" TIMESTAMP DEFAULT SYS_EXTRACT_UTC(SYSTIMESTAMP) NOT NULL
);
insert into "BOROO"."CMS_TEMP" (NAME)
values ('new name 1');
select TO_CHAR(RCDATE, 'YYYY-MM-DD HH24:MI:SS.FF') from CMS_TEMP;
inMSSQL
DROP TABLE [dbo].[table1]
GO
/****** Object: Table [dbo].[table1] Script Date: 3/21/2017 5:50:45 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[table1](
[ID] [uniqueidentifier] ROWGUIDCOL NOT NULL CONSTRAINT [DF_table1_ID] DEFAULT (newid()),
[Name] [nvarchar](50) NOT NULL,
[rcdate] datetime NOT NULL DEFAULT GETUTCDATE()
) ON [PRIMARY]
GO
insert into table1(name)
values ('name 1');
GO
select rcdate from table1;
inMySQL
CREATE TABLE `table1` (
`id` char(36) DEFAULT NULL,
`name` varchar(250) NOT NULL,
`rcdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
No comments:
Post a Comment