Class SqlCmdVariable
- Namespace
- ItTiger.TigerQuery
- Assembly
- ItTiger.TigerQuery.dll
Holds a case-insensitively named sqlcmd variable and its override policy.
public sealed class SqlCmdVariable
- Inheritance
-
SqlCmdVariable
- Inherited Members
Constructors
SqlCmdVariable(string, string, bool)
Initializes a sqlcmd variable.
public SqlCmdVariable(string name, string value, bool canBeOverridden = true)
Parameters
namestring- The variable name without reference delimiters.
valuestring- The initial replacement value.
canBeOverriddenbool- Whether subsequent script assignments may replace
value.
Properties
CanBeOverridden
Gets whether a
:setvar command may replace this variable's value.public bool CanBeOverridden { get; }
Property Value
Name
Gets the variable name without
$( and ) delimiters.public string Name { get; }
Property Value
Value
Gets the current replacement value.
public string Value { get; }
Property Value
Methods
TrySet(string)
Attempts to replace the variable's value.
public bool TrySet(string newValue)
Parameters
newValuestring- The proposed replacement value.
Returns
- bool
- true when the value was replaced; otherwise false because CanBeOverridden is false.