我收到错误:
MSG 4145:在预期条件的上下文中指定的非布尔类型的表达式,靠近' Left'
思想?
USE [DatabaseName]
GO
/****** Object: StoredProcedure [dbo].[spFilePlanNavigate] Script Date: 03/19/2015 14:54:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[spFilePlanNavigate](@CategoryId int)
As
Set NoCount On
Begin
If @CategoryId > 0
Select FilePlan.*, Retention.Retention_Type, Retention.Retn_Description1
From FilePlan, Retention
Where FilePlan.Retention_Code Left Outer Join Retention.Retention_Code
And FilePlan.Category_Id = @CategoryId
Else
Select FilePlan.*, Retention.Retention_Type, Retention.Retn_Description1
From FilePlan, Retention
Where FilePlan.Retention_Code Left Outer Join Retention.Retention_Code
And FilePlan.Category_Id_Parent = @CategoryId
End
答案 0 :(得分:0)
左外连接具有以下语法:
select cola, colb from table1 left outer join table2
on table1.id = table2.id
where table.catid = @catid
您的sql语句缺少' on' ' on'子句告诉SQL Server匹配列出的匹配列的行。