2013-01-24 28 views
1

我有什麼錯誤存儲過程作爲錯誤在存儲過程中

Create proc [dbo].[DNNCentric_TechAnyClass_Course_FilterByCategory] 
@CategoryName nvarchar(350)='Business' 
AS 
BEGIN 
Declare @Category nvarchar(350) 
Set @Category="" 
if(@CategoryName='Business') 
begin 
    Set @[email protected] 
end 
select Course.CourseId,Course.CourseTitle,Course.CourseDescription,Category.CategoryName,FormatMaster.FormatType,Teacher.TeacherName 
From dbo.DNNCentric_TechAnyClass_CategoryMaster As Category 
    Inner Join dbo.DNNCentric_TechAnyClass_Course As Course ON Category.CategoryID = Course.CategoryId 
    Inner Join dbo.DNNCentric_TechAnyClass_FormatMaster As FormatMaster ON FormatMaster.FormatID = Course.FormatID 
    Inner Join dbo.DNNCentric_TechAnyClass_Teacher As Teacher ON Teacher.TeacherId=Course.TeacherId 
Where [email protected] 
END 

它顯示和誤差

Msg 1038, Level 15, State 4, Procedure DNNCentric_TechAnyClass_Course_FilterByCategory, Line 6 
An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name. 

,我對任何援助commiting.Thanks。

回答

5
Set @Category="" 

應該

SET @Category='' 

雙引號(「)應該是單引號(')

+0

感謝它。 –

+0

沒有問題,隨時隨地 –