关键字 'convert' 附近的语法不正确
Incorrect syntax near the keyword 'convert'
我有手续
create procedure dbo.updateView(@cobdate datetime)
as
begin
Update hir_view set ValidTo=@cobdate where HierarchyId in (
select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in (
select HierarchyId from hir_organisation where ValidTo>getDate()
)
) and ValidTo>getDate()
end
go
当我尝试使用
调用它时
exec updateView(
convert(
dateTime,'20160209')
);
我收到错误说明
查找错误 - 消息 156,级别 15,状态 34,服务器 DSLNPHX02,第 18 行 - Sybase 数据库错误:关键字 'convert'.
附近的语法不正确
我不确定我哪里错了
语法正确,你试过运行这样的更新命令吗
convert(dateTime,'20160209')
Update hir_view set ValidTo=convert(dateTime,'20160209') where HierarchyId in (
select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in (
select HierarchyId from hir_organisation where ValidTo>getDate()
)
) and ValidTo>getDate()
我有手续
create procedure dbo.updateView(@cobdate datetime)
as
begin
Update hir_view set ValidTo=@cobdate where HierarchyId in (
select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in (
select HierarchyId from hir_organisation where ValidTo>getDate()
)
) and ValidTo>getDate()
end
go
当我尝试使用
调用它时exec updateView(
convert(
dateTime,'20160209')
);
我收到错误说明 查找错误 - 消息 156,级别 15,状态 34,服务器 DSLNPHX02,第 18 行 - Sybase 数据库错误:关键字 'convert'.
附近的语法不正确我不确定我哪里错了
语法正确,你试过运行这样的更新命令吗
convert(dateTime,'20160209')
Update hir_view set ValidTo=convert(dateTime,'20160209') where HierarchyId in (
select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in (
select HierarchyId from hir_organisation where ValidTo>getDate()
)
) and ValidTo>getDate()