SQL Constrain to insert the current date in the column but it leaves 1900-01-01

3

When I want to insert a student, I want to insert the current date automatically with the constrain in Date-Registration.

ALTER table TB_ALUMNO
ADD CONSTRAIT FECH_MATRI_ALU DEFAULT GETDATE() 
FOR FECH_MATRI_ALU
GO

I get 1900-01-01 instead of the current date in the column

    
asked by Junior Flores Alcantara 01.12.2018 в 07:00
source

1 answer

0

I think you have some syntax errors, it should be like this:

alter table YourTubName add constraint NombreDelConstraint default getdate () for NombreDelCampo GO

    
answered by 05.12.2018 в 22:52