| | |
Help with Stored Procedure
Please support our MS SQL advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2005
Posts: 483
Reputation:
Solved Threads: 19
ok, here is the script I ran to create the stored procedure
but when I run it I keep getting
Cannot insert the value NULL into column 'Class', table 'documentation.dbo.tblFunction'; column does not allow nulls. INSERT fails.
The statement has been terminated.
when i run the procedure substituting values for the variables, it works fine.
Any ideas?
MS SQL Syntax (Toggle Plain Text)
SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO CREATE PROCEDURE [insertFunction] (@Id [int], @class [nvarchar], @type [nvarchar], @name [nvarchar]) AS declare @classID [int] SELECT @classID = tblClass.ID FROM tblClass WHERE tblClass.Name = @class INSERT INTO tblFunction ([ID],[Name],[ReturnType],[Class]) VALUES (@Id,@name,@type,@classID) GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO
but when I run it I keep getting
Cannot insert the value NULL into column 'Class', table 'documentation.dbo.tblFunction'; column does not allow nulls. INSERT fails.
The statement has been terminated.
when i run the procedure substituting values for the variables, it works fine.
Any ideas?
![]() |
Similar Threads
- PHP MySQL 5.0 stored procedure (PHP)
- How to connect a SQL stored procedure to a windows application? (VB.NET)
- Formatted Output in Stored Procedure (MS SQL)
- Pbm with stored procedure (Oracle)
- Can return a Stored Procedure Recordset (MS SQL)
- Help with a stored procedure (MS SQL)
- how do I run a "disconnected" stored procedure (MS SQL)
- Stored procedure call with ADO (C)
Other Threads in the MS SQL Forum
- Previous Thread: Help With SQL Server Agent
- Next Thread: can not connect to db
| Thread Tools | Search this Thread |





