Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SqlCommand Parameters - how to record TVP
Message
 
 
À
Tous
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Titre:
SqlCommand Parameters - how to record TVP
Divers
Thread ID:
01672921
Message ID:
01672921
Vues:
50
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
Répondre
Fil
Voir

Click here to load this message in the networking platform