Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SqlCommand Parameters - how to record TVP
Message
 
 
To
All
General information
Forum:
C#
Category:
Coding, syntax and commands
Title:
SqlCommand Parameters - how to record TVP
Miscellaneous
Thread ID:
01672921
Message ID:
01672921
Views:
51
Hi everybody,

I have a method allowing me to record information about parameters passed to SQL command. This is quite helpful when we want to try to re-run the query later using the log file.

Today I've added a TVP to one of my command.

This is what I have in my method so far:
if (parameter.SqlDbType != SqlDbType.Structured)
                            {
                                info.Append($"{parameter.ParameterName} {parameter.SqlDbType.ToString().TrimEnd()}{sizeInfo} = ");
                            }
                            else
                            {
                                info.Append($"{parameter.ParameterName} {parameter.TypeName}");
                            }
I'd like to be able to create the insert statements for that parameter similar to what we have when we look into SQL Profiler. Do you know how can I do that?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Reply
Map
View

Click here to load this message in the networking platform