I have 9 different parameters which are coming in from an XML document, and they may or may not be entered by the user. When I am parsing the XML I am setting a string to the value of the relevant parameter, so if the value is entered by the user, the string will equal that value, otherwise the string will be empty.
I then want to pass these parameters to a stored procedure to update a table, but obviously if the string is empty I don't want this particular field to be updated as it would overwrite a value that may already be in there with an empty string.
I can do this in SQL in my code by building up a string and executing it, but I can't think of how I can do this with a stored procedure, given that I need to make the stored procedure have the ability to receive all of the 9 parameters, whether they are empty or not, and to write a different Update statement for every combination of these paramters would take too long.
Can anybody help me out with this?
Any help would be really appreciated.
Cheers,
lfc77
I then want to pass these parameters to a stored procedure to update a table, but obviously if the string is empty I don't want this particular field to be updated as it would overwrite a value that may already be in there with an empty string.
I can do this in SQL in my code by building up a string and executing it, but I can't think of how I can do this with a stored procedure, given that I need to make the stored procedure have the ability to receive all of the 9 parameters, whether they are empty or not, and to write a different Update statement for every combination of these paramters would take too long.
Can anybody help me out with this?
Any help would be really appreciated.
Cheers,
lfc77