somanivivek
IS-IT--Management
Hi,
In a table, I have 'lastupdateddate' column.
This has to get updated with current datetime when a row is inserted.
The insert statement will not insert anything into this column...
How to go about it...
For e.g
I have a table
Create table test
( name varchar(20), lastupdateddate datetime())
I have set the default value of lastupdateddate to getdate().
When I run the insert statement, it gives error that the Column name or number of supplied values does not match table definition...
My insert statement is :
Insert into test values ('vivek')
How can I use the above statement and still get the current datetime inserted into the lastupdated field ??
Thanks
Vivek
In a table, I have 'lastupdateddate' column.
This has to get updated with current datetime when a row is inserted.
The insert statement will not insert anything into this column...
How to go about it...
For e.g
I have a table
Create table test
( name varchar(20), lastupdateddate datetime())
I have set the default value of lastupdateddate to getdate().
When I run the insert statement, it gives error that the Column name or number of supplied values does not match table definition...
My insert statement is :
Insert into test values ('vivek')
How can I use the above statement and still get the current datetime inserted into the lastupdated field ??
Thanks
Vivek