Link to home
Start Free TrialLog in
Avatar of firekiller15
firekiller15

asked on

error received if both field timestamp in a table

I have a table called table A in database and this table has two field
Datatype of this two field is timestamp.
when i try to save this change, error occur why?


Avatar of Aneesh
Aneesh
Flag of Canada image

Hello firekiller15,

can you tell me the exact error message ? also i assume that those are datetime columns, whenever you enter the date enter it in this YYYY-mm-DD  format


GOD BLESS,

Aneesh R.
Avatar of firekiller15
firekiller15

ASKER

In MSSQL i try to create a table with two field.
both field i have my data type (timestamp). when i try to save my changes
error  as attached below occur
error.JPG
Note that is also mention
table can only have one timestamp colum why?
make sure your query looks like this
"Insert Into TableName (DateColumn) Value ('" & Format(dateVariable, "MM/dd/yyyy") & "')"
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i cannot even can create a table because of the datatype problem
that why i post this question on why cannot have two timestamp in one table.
How can i insert value before i create a table

.......
thanks anneshattingal ,
but can you tell me more or do you have any good url that i can read thru' to know more about this.
In sql server what timestamp really do?
sorry for my last post. I thought its about DateTime

You cannot have more than one TimeStamp column in a table, since it behaves as a row identifier in the table. Its used for maintining the versioniong of the rows.
following will give you a correct picture
http://msdn2.microsoft.com/en-us/library/ms182776.aspx
in http://msdn2.microsoft.com/en-us/library/ms182776.aspx what is
version-stamping table rows mean
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>version-stamping table rows mean
The values on the 'timestamp' column will automatically get updated whenever you change a value on that particular row. You cannot explicity mention a value on that column, sql serve internally handles this
and it generates based on the current date & time.. most importantly it is suppose to be unique in the database