我正致力于从Oracle到SQL Server 2012的服务器迁移。
在存储过程中我有
select
@Months = datediff(m, getdate(), cast('12/01/' + CAST(year(getdate()) + 1 as varchar(4)) as datetime))
我是否需要对此查询进行任何更改才能在SQL Server中成功运行?或者它会正常工作?这里使用的函数(在Oracle中)在SQL Server中几乎相同(现在我没有链接服务器来测试)。
答案 0 :(得分:0)
getdate(),datediff()和Cast()在SQL Server中都是有效的