0

I have two varchar(max) parameters in a SQL Stored Procedure. One of which is a readable string generated in C# that is provided to the user to display what values for a particular record have changed. The other, is an XML representation of the string, which I am parsing through and adding to a DB Table a record for each of the Modified values.

To make a long explanation short, the readable string contains user friendly values of the DB columns that the user can recognize; while the XML representation contains the DB Table's Field/Column Name as it appears in the DB design view.

Is there a performance hit in passing the two varchar(max) parameters to the SQL Stored Procedure?

If so, would it be beneficial to pass only one of the varchar(max) parameter and setup a User-Define-Function that will parse through the parameter and create the user friendly values to display to the user? I'm concerned that there will be multiple calls to the User-Defined-Function, resulting in a performance hit.

Thoughts?

Thanks! Rusty

Rusty
  • 1
  • 1
    a few quick questions, since the first nvarchar is just a human readable version why do you even need to pass it ? Secondly why don't you just pass the xml data as an XML datatype and process it in the stored procedure ? – Johnv2020 Apr 28 '11 at 19:06

1 Answers1

2

Have you any reason to believe that passing through the two parameters is slower than passing through just one?

I'd doubt that passing through a single parameter and having it torn apart by a UDF would be any faster, and the added complexity would be hard to justify if not.

Will A
  • 24,780
  • 5
  • 50
  • 61