I&#039;m trying to call this stored procedure multiple times in the same transaction to insert notes that relate to servers and databases....<BR><BR>CREATE PROCEDURE spinsertnoteassociations<BR>@idnote INT,<BR>@idserver INT = null,<BR>@iddatabase INT = null<BR>AS<BR>INSERT INTO noteassociations(idnote, idserver, iddatabase)<BR>SELECT @idnote, @idserver, @iddatabase<BR>GO<BR><BR>The purpose of this SP is to insert a idnote, (required), and either an idserver or an iddatabase.. <BR><BR>I am able to loop through and execute to insert some notes for servers, but when I try to insert notes for databases it errors out. It is trying to insert the iddatabase in the server column. Here is how I add the database parameter...<BR><BR>cmd.Parameters.Delete "@idserver" &#039;***previous parameter for inserting servers<BR><BR>cmd.Parameters.Append cmd.CreateParameter("@iddatabase", adInteger, adParamInput, 4, database_item.id)<BR><BR>cmd.Execute<BR><BR><BR>If debugged and determined that the parameter called @iddatabase is on the command object and that a correct value is associated with it. I&#039;ve also executed the SP from query analizer with no problems.<BR><BR><BR>Any suggestions??<BR><BR>