msyed1
asked on
Initialize DateTime to 01/01/0001 in MS SQL Server
Hello,
I have a date column defined in SQL Server as Datetime. Starting out, when I first Insert this row in the table, I want to initialize it to something like 01/01/0001 so it does not default to NULLS. Please let me know how to do this in VB.Net. msyed1.
Set it to zero.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
BTW, you can also change the database default to something else.
ASKER
I like the idea of defining a default for my date columns in my table. When I do a SP_Columns on my table, I see a COLUMN_DEF. Can you show me how to assign a default value to the ActiveDate column below.
CREATE table NewTable
REquestID int Not NUll,
Workflowstep int,
ApprovedId char (1),
ActiveDate DateTime
on Primary
Go
CREATE table NewTable
REquestID int Not NUll,
Workflowstep int,
ApprovedId char (1),
ActiveDate DateTime
on Primary
Go
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you all....