I am trying to insert data into a table and continue to
receive the following error message:
"INSERT failed because the following SET options have
incorrect settings: 'ANSI_NULLS., QUOTED_IDENTIFIER'."
I have tried every combination of set options for
ANSI_Nulls and Quoted_Identifier right before the insert
statement but it still does not work.
If I use Query Analyzer to insert the information it
functions properly but when called via the following
stored procedure the problem occurs.
CREATE PROCEDURE Courses_Link
(
)
AS
set nocount on
declare curCategories1 cursor for
Select GC.Title, GC.GradePercentage, GC.BGColor,
DropLowestGrade, DisplayRank, MarkingPeriodID, SynchGuid
from GradeCategory AS GC
open curCategories1
begin
if(Not Exists (select * from GradeCategory
begin
set quoted_identifier on
set ArithAbort on
--set ansi_nulls on
-- PROBLEM OCCURS HERE
insert GradeCategory
([Title], [GradePercentage],
[DisplayRank], [BGColor], [DropLowestGrade], [CourseID],
[MarkingPeriodID], [SynchGuid])
values
end
fetch next from curCategories1 into
end
close curCategories1
deallocate curCategories1
declare curCategories2 cursor for
Select GC.Title, GC.GradePercentage, GC.BGColor,
DropLowestGrade, DisplayRank, MarkingPeriodID, SynchGuid
from GradeCategory AS GC
open curCategories2
begin
GradeCategory
/*
begin
insert GradeCategory
(Title, GradePercentage, DisplayRank,
BGColor, DropLowestGrade, CourseID, MarkingPeriodID,
SynchGuid)
values
end
else
Begin
update GradeCategory
set
where
End
*/
fetch next from curCategories2 into
end
close curCategories2
deallocate curCategories2
return
GO
I have marked where the problem occurs with -- PROBLEM
OCCURS HERE.
Other information that may be relevant:
- I have Indexed Views that are referencing the
GradeCategory table
- Running SQL Server 2000 Enterprise Edition
Any advice would be greatly appreciated.
Thanks in advance.
Tom