Help with Stored Procedure

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2005
Posts: 483
Reputation: campkev is an unknown quantity at this point 
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Help with Stored Procedure

 
0
  #1
Aug 4th, 2005
ok, here is the script I ran to create the stored procedure
  1. SET QUOTED_IDENTIFIER ON
  2. GO
  3. SET ANSI_NULLS ON
  4. GO
  5.  
  6.  
  7.  
  8.  
  9. CREATE PROCEDURE [insertFunction] (@Id [int], @class [nvarchar], @type [nvarchar], @name [nvarchar]) AS
  10.  
  11. declare @classID [int]
  12. SELECT @classID = tblClass.ID FROM tblClass WHERE tblClass.Name = @class
  13.  
  14.  
  15.  
  16. INSERT INTO tblFunction
  17. ([ID],[Name],[ReturnType],[Class])
  18. VALUES
  19. (@Id,@name,@type,@classID)
  20. GO
  21. SET QUOTED_IDENTIFIER OFF
  22. GO
  23. SET ANSI_NULLS ON
  24. 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?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC