I have read up on this but still cannot understand. Hope someone here may explain it to me. I have a query that assigns a current date only value to my column. However I would like to know if I should create the new column as DATETIME
or SMALLDATETIME
if my query is like:
Insert into table(col A)
Select DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0) As ColA
from table B
I guess my select statement will already give me the date value without time. I am doubtful on the creation of Col A
in my db table. I am using Sql 2005.
Update:
So my qns is how to create my Column A in my db table? Do i need to add constraint to it? Which datatype is preferred?