# SQL Parameters

## 🔢 What are SQL Parameters ?

Using SQL parameters you can create dynamic queries based on either static parameter values or ,thanks to ngSurvey's [piping features](https://docs.ngsurvey.com/form-management/campaigns/campaign/invitation-message/invitation-piping-tags), create dynamic parameters that will get their values from respondent answers, querystring or system settings.

![](https://1025048312-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8fLhS0bmfBRyq0HdUm%2F-MC0assgBm6jfkNh2R5j%2F-MC0cD87oOdcXEFAtfZD%2Fimage.png?alt=media\&token=4b307daa-8ee8-4a09-a29f-906a92e84abc)

In the example above the **@CompanyId** tag will be replaced by the value of the SQL Parameter that matches his name.&#x20;

{% hint style="info" %}
To use a SQL parameter inside your SQL query you have to prefix the parameter with the **@** char.
{% endhint %}

## 🔅 SQL Parameters properties

![](https://1025048312-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8fLhS0bmfBRyq0HdUm%2F-MC0assgBm6jfkNh2R5j%2F-MC0clxaGIdO04Z-K-cI%2Fimage.png?alt=media\&token=87f0bdf5-f6b1-4095-8ca2-fd6e49062519)

* **`Parameter name`** Name of the parameter that will be replaced in the sql query. Do not include the **@** chart in your parameter names as its already added by ngSurvey at runtime.
* **`Parameter value`** value of the parameter being replaced. The parameter value can also be [piped ](https://docs.ngsurvey.com/form-management/form-designer/piping/text-data-piping)using either a static value or dynamic [piped value](https://docs.ngsurvey.com/form-management/campaigns/campaign/invitation-message/invitation-piping-tags).

{% hint style="info" %}
[Piped](https://docs.ngsurvey.com/form-management/campaigns/campaign/invitation-message/invitation-piping-tags) answers are piped in real-time in the parameter value as such you may use this feature to achieve [cascade (parent/child) relationship](https://docs.ngsurvey.com/form-management/form-designer/answers/answer-types/creating-new-type/lists/sql-server-lists/parent-child-related-lists) between several lists.
{% endhint %}
