Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
I was wondering if anyone can help me. I am trying to write a stored procedure that selects a documentid (unique id) from a table and inserts the output (along with other data) into another table. This is what I have, it isn’t returning a documentid from the select. When I execute it inside of SQL Server 2005, it works fine. But when I do it in my .NET app, it says DocumentID can’t be null in ttdTheis_Author, which tells me the output param @DocumentID is not being passed to the insert sql call…any ideas?Thanks /PALTER PROCEDURE [dbo].[snpAuthorInsert] (@AccessionNum varchar (9), @AuthorName varChar(100), @DocumentID int output) asset @DocumentID = (select documentID from ttdThesisInfo where AccessionNum = @AccessionNum) insert into ttdThesis_Author (DocumentID, Author) values (@DocumentID, @AuthorName)