Convert list of non compliant Parameters to Type Safe.
-
Before you begin select the output type for Parameters that matches that used in the Parameters you are converting. Now add the relevant tables to the Tables and Aliases list. Paste the list of Parameters into the editor. One parameter definition per line.
When you're looking at converting parameters this is one option you can use. When you have a query that has been written with AddWithValue parameters this is an easy way to edit just the parameters so they are Type Safe. Another approach is to revert the whole query. Revert Query This will remove all parameters from the query. When you then select the Auto Process SQL option and the RUN button the parameterisation will be fully typed. The processing of parameters only relies on the developer having followed a common practice of naming parameters after the column name for example, CustomerID would become @CustomerID. If this practice is not follwed then the failure to identify a column name will open a dialogue which asks you to identify the Column name for a parameter. The reversion of a query process does not have this limitation.
-
Select the Convert Pars to Fully Typed radio button option. Paste the Parameters only into the editor. Now hit F5 or the RUN button to convert to type safe parameters.
-
It should be pointed out that most processing will destroy the pasted query. There are pre processing edits that are sometimes required and this will not necessarily leave the query syntactically correct. It would be unwise to paste a query from the editor back into source code. You should only copy from the Results pane back into source code. You can recover the original pasted query weith the Undo Menu 'Recover Original Query'
Important
These related links may be helpfull to this topic