Table of Contents

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

name string
The variable name without reference delimiters.
value string
The initial replacement value.
canBeOverridden bool
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

bool

Name

Gets the variable name without $( and ) delimiters.
public string Name { get; }

Property Value

string

Value

Gets the current replacement value.
public string Value { get; }

Property Value

string

Methods

TrySet(string)

Attempts to replace the variable's value.
public bool TrySet(string newValue)

Parameters

newValue string
The proposed replacement value.

Returns

bool
true when the value was replaced; otherwise false because CanBeOverridden is false.