如何在SQL Server表中插入时间戳列 [英] How to insert timestamp column in sql server table

查看:218
本文介绍了如何在SQL Server表中插入时间戳列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的表格中,我的列带有时间戳数据类型.在这里,我插入了datetime和smalldatetime和时间,但是没有插入.

我在日期时间附近收到了不正确的语法错误.

请帮帮我......

Hi In my table i have column with timestamp datatype. here i am inserted datetime and smalldatetime and time but its not taking .

I am getting Incorrect Syntax error near datetime.

Please Help me...............

推荐答案

不建议使用名称时间戳,新名称(更准确的名称)为行版本.

rowversion类型的SQL Server列始终由数据库服务器生成和设置.

如果在目标表中使用其他数据类型.从rowversion列读取的值可以存储在varbinary列中.因此,您可以在新表中创建一个varbinary列,以保存旧表中的值.当然,前进此varbinary列不会像rowversion列那样自动更新.
The name timestamp is deprecated, the new (and more accurate) name is rowversion.

SQL Server columns of type rowversion are always generated and set by the database server.

If you use a different datatype in the target table. The values read from a rowversion column can be stored in a varbinary column. So you could create a varbinary column in the new table to hold the values from the old table. Of course, going forward this varbinary column would not get updated automatically like a rowversion column would.



请参考以下链接:
http://sqlserver2000.databases.aspfaq.com/how-do-i-audit-changes-to-sql-server-data.html [
Hi,
Refer to following link:
http://sqlserver2000.databases.aspfaq.com/how-do-i-audit-changes-to-sql-server-data.html[^]


这篇关于如何在SQL Server表中插入时间戳列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆