-
Set up a project and/or load the correct project.
-
Select an Output Type (SqlDataAdapter, SqlCommand or Sql Parameter Array). This determines the parameter format.
-
If the output type is Sql Parameter Array, optionally enter a name for the parameter array. (If you leave this empty, the default name is P.)
-
Copy and paste the code to be converted into the Sql Editor pane. Generally you should copy the entire sql statement including surrounding quotes. If the output type is SqlCommand or SqlDataAdapter, copy the line of code that sets the CommandText or SelectCommand of the SqlCommand or DataAdapter.
Examples of Code that can be Pasted into the Editor
This example includes the name of the SqlCommand object. This allows fix SQL Editor to detect the correct name and use it in the output.
This is the same query above but this time, only the sql statement has been included. This would be appropriate if the output type is SqlParameter and there is no need for fix SQL Editor to detect the name of a SqlCommand object or SQLDataAdapter object.
This example shows a more complex sql statement that includes 2 queries concatenated together.
-
Click Run F5. fix SQL Editor will connect to your database to determine the data type for each parameter, then will parameterize the query. If there are any issues with the output, see Troubleshooting Processing
-
If you want to change the names given to any of the parameters, you can do so using the Find Replace button on the Sql Output pane.
-
If you want to check the SQL statement in the output for errors, select just the commandText in the Sql Output pane and click SQL Parser. Note this can occasionally give false positives so use your programming skills to determine if there is a genuine issue. This can save you a lot of time as the parser will reliably find syntax issues like missing commas.
-
Use the copy button on the Sql Output pane to copy the final result before pasting it back into your source code. Don't bother selecting the text, the copy button will do this for you.
Important Info
This application doesn't rely on string manipulation to process Queries although it does utilise some regex matching and other string manipulation this is not the core method for processing SQL. The system relies heavily on SQL Tokens. This technology is a fantastic enabler for the procedure however it comes with a couple of drawbacks. These are listed below