April 9, 2003 at 11:06 am
Ok. I have a table with a computed column. There is an index on this table with only the computed column. When doing an insert in query analyzer, it works. However, if I do the same exact insert in a stored procedure, I get INSERT failed because the following SET options have incorrect settings: 'ANSI_NULLS.'.
I have this in each of the updates:
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
SET ARITHABORT ON
SET CONCAT_NULL_YIELDS_NULL ON
SET QUOTED_IDENTIFIER ON
SET NUMERIC_ROUNDABORT OFF
as specified in this article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_05_8os3.asp
I can supply code that will generate this if anyone needs it.
Any ideas????
-- Joe
April 10, 2003 at 2:48 am
These things should not be set within the code of the stored procedure. In fact, some of them can't be changed by doing this within the stored procedure.
They should be set when you create the stored procedure. Called prior to the Create procedure statement.
Like this:
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
SET ARITHABORT ON
SET CONCAT_NULL_YIELDS_NULL ON
SET QUOTED_IDENTIFIER ON
SET NUMERIC_ROUNDABORT OFF
GO
Create procedure dbo............
April 10, 2003 at 7:22 am
Rawhide, good suggestion, but that didn't do it.
UPDATE: That fixed the problem partially. The stored procedure now runs in query analyzer successfully, but when I run it from ASP.NET, I get ERROR: INSERT failed because the following SET options have incorrect settings: 'ARITHABORT'.
" still.
Any ideas?
Edited by - jkalin1 on 04/10/2003 07:35:16 AM
April 14, 2003 at 9:21 am
Any other ideas anyone?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply