如何在MS SQL Server中使用Spring JDBCNamedParameterTemplate插入current_timestamp?

问题描述 投票:0回答:1

我在MS SQL Server中使用Spring JDBCNamedParameterTemplate使用准备好的语句

String sqlUpsateEntity = "update mytable \n" + "set name = :myname, Current_Date = current_timestamp from mytable where mytable_id = :id";

“ Current_Date = current_timestamp”给出错误

com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'Current_Date'."

如何插入当前时间戳?

sql-server spring-jdbc
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.