Beginner in sql server

  • Hello,

    How to add a UNIX_TIMESTAMP at my publish_date please

    CREATE TABLE [dbo].[latest_info](
    [id] [int] IDENTITY(1,1) NOT NULL,
    [type] [varchar](20) NULL,
    [number] [varchar](255) NULL,
    [varchar](255) NULL,
    [title] [varchar](255) NULL,
    [text] [text] NULL,
    [publish_date] [varchar](255) NULL,
    [author] [varchar](50) NULL,
    [icon] [varchar](50) NULL,
    PRIMARY KEY CLUSTERED
    (
    [id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO

    ALTER TABLE [dbo].[latest_info] ADD DEFAULT (CURRENT_TIMESTAMP) FOR [publish_date]
    GO​

     

    • This topic was modified 5 hours, 10 minutes ago by YuChan.

Viewing post 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply