November Happy Hour will be moved to Thursday December 5th.

Class SqlScript

Represents Sql Script .

Inheritance
System.Object
SqlScript
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.BusinessFoundation.Data.Sql
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 12.17.2
Syntax
public class SqlScript : IDisposable

Constructors

SqlScript()

Initializes a new instance of the SqlScript class.

Declaration
public SqlScript()

SqlScript(Int32)

Initializes a new instance of the SqlScript class.

Declaration
public SqlScript(int capacity)
Parameters
Type Name Description
System.Int32 capacity

Properties

Parameters

Gets or sets the parameters.

Declaration
public SqlParameterList Parameters { get; set; }
Property Value
Type Description
SqlParameterList

The parameters.

Text

Gets or sets the script.

Declaration
public StringBuilder Text { get; set; }
Property Value
Type Description
System.Text.StringBuilder

The script.

Methods

AddAutoParameter(SqlDbType, Object)

Adds the auto parameter.

Declaration
public SqlScript AddAutoParameter(SqlDbType dbType, object value)
Parameters
Type Name Description
System.Data.SqlDbType dbType

Type of the db.

System.Object value

The value.

Returns
Type Description
SqlScript

AddParameter(SqlParameter)

Adds the parameter.

Declaration
public SqlScript AddParameter(SqlParameter param)
Parameters
Type Name Description
System.Data.SqlClient.SqlParameter param

The param.

Returns
Type Description
SqlScript

AddParameter(String, SqlDbType, Int32, Object)

Adds the parameter.

Declaration
public SqlScript AddParameter(string parameterName, SqlDbType dbType, int size, object value)
Parameters
Type Name Description
System.String parameterName

Name of the parameter.

System.Data.SqlDbType dbType

Type of the db.

System.Int32 size

The size.

System.Object value

The value.

Returns
Type Description
SqlScript

AddParameter(String, SqlDbType, Object)

Adds the parameter.

Declaration
public SqlScript AddParameter(string parameterName, SqlDbType dbType, object value)
Parameters
Type Name Description
System.String parameterName

Name of the parameter.

System.Data.SqlDbType dbType

Type of the db.

System.Object value

The value.

Returns
Type Description
SqlScript

AddParameter(String, Object)

Adds the parameter.

Declaration
public SqlScript AddParameter(string parameterName, object value)
Parameters
Type Name Description
System.String parameterName

Name of the parameter.

System.Object value

The value.

Returns
Type Description
SqlScript

Append(Boolean)

Declaration
public SqlScript Append(bool value)
Parameters
Type Name Description
System.Boolean value
Returns
Type Description
SqlScript

Append(Byte)

Declaration
public SqlScript Append(byte value)
Parameters
Type Name Description
System.Byte value
Returns
Type Description
SqlScript

Append(Char)

Declaration
public SqlScript Append(char value)
Parameters
Type Name Description
System.Char value
Returns
Type Description
SqlScript

Append(Char, Int32)

Declaration
public SqlScript Append(char value, int repeatCount)
Parameters
Type Name Description
System.Char value
System.Int32 repeatCount
Returns
Type Description
SqlScript

Append(Char[])

Declaration
public SqlScript Append(char[] value)
Parameters
Type Name Description
System.Char[] value
Returns
Type Description
SqlScript

Append(Char[], Int32, Int32)

Declaration
public SqlScript Append(char[] value, int startIndex, int charCount)
Parameters
Type Name Description
System.Char[] value
System.Int32 startIndex
System.Int32 charCount
Returns
Type Description
SqlScript

Append(Decimal)

Declaration
public SqlScript Append(decimal value)
Parameters
Type Name Description
System.Decimal value
Returns
Type Description
SqlScript

Append(Double)

Declaration
public SqlScript Append(double value)
Parameters
Type Name Description
System.Double value
Returns
Type Description
SqlScript

Append(Int16)

Declaration
public SqlScript Append(short value)
Parameters
Type Name Description
System.Int16 value
Returns
Type Description
SqlScript

Append(Int32)

Declaration
public SqlScript Append(int value)
Parameters
Type Name Description
System.Int32 value
Returns
Type Description
SqlScript

Append(Int64)

Declaration
public SqlScript Append(long value)
Parameters
Type Name Description
System.Int64 value
Returns
Type Description
SqlScript

Append(Object)

Declaration
public SqlScript Append(object value)
Parameters
Type Name Description
System.Object value
Returns
Type Description
SqlScript

Append(Single)

Declaration
public SqlScript Append(float value)
Parameters
Type Name Description
System.Single value
Returns
Type Description
SqlScript

Append(String)

Declaration
public SqlScript Append(string value)
Parameters
Type Name Description
System.String value
Returns
Type Description
SqlScript

Append(String, Int32, Int32)

Declaration
public SqlScript Append(string value, int startIndex, int count)
Parameters
Type Name Description
System.String value
System.Int32 startIndex
System.Int32 count
Returns
Type Description
SqlScript

AppendFormat(IFormatProvider, String, Object[])

Declaration
public SqlScript AppendFormat(IFormatProvider provider, string format, params object[] args)
Parameters
Type Name Description
System.IFormatProvider provider
System.String format
System.Object[] args
Returns
Type Description
SqlScript

AppendFormat(String, Object)

Declaration
public SqlScript AppendFormat(string format, object arg0)
Parameters
Type Name Description
System.String format
System.Object arg0
Returns
Type Description
SqlScript

AppendFormat(String, Object, Object)

Declaration
public SqlScript AppendFormat(string format, object arg0, object arg1)
Parameters
Type Name Description
System.String format
System.Object arg0
System.Object arg1
Returns
Type Description
SqlScript

AppendFormat(String, Object, Object, Object)

Declaration
public SqlScript AppendFormat(string format, object arg0, object arg1, object arg2)
Parameters
Type Name Description
System.String format
System.Object arg0
System.Object arg1
System.Object arg2
Returns
Type Description
SqlScript

AppendFormat(String, Object[])

Declaration
public SqlScript AppendFormat(string format, params object[] args)
Parameters
Type Name Description
System.String format
System.Object[] args
Returns
Type Description
SqlScript

AppendLine()

Declaration
[ComVisible(false)]
public SqlScript AppendLine()
Returns
Type Description
SqlScript

AppendLine(String)

Declaration
[ComVisible(false)]
public SqlScript AppendLine(string value)
Parameters
Type Name Description
System.String value
Returns
Type Description
SqlScript

Clear()

Clears this instance.

Declaration
public void Clear()

CreateSP(String)

Executes the create storage procedure script.

Declaration
public void CreateSP(string spName)
Parameters
Type Name Description
System.String spName

Name of the sp.

CreateSP(String, String[], String[])

Executes the create storage procedure script.

Declaration
public void CreateSP(string spName, string[] scriptPrefix, string[] scriptPostfix)
Parameters
Type Name Description
System.String spName

Name of the storage procedure.

System.String[] scriptPrefix

The script prefix.

System.String[] scriptPostfix

The script postfix.

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

Execute()

Executes the script.

Declaration
public void Execute()

ExecuteSql()

Optimizeds the execute using sp_executesql.

Declaration
public void ExecuteSql()

GetCreateSPScript(String)

Gets the create storage procedure script.

Declaration
public string GetCreateSPScript(string spName)
Parameters
Type Name Description
System.String spName

Name of the sp.

Returns
Type Description
System.String

GetCreateSPScript(String, String[], String[])

Gets the create storage procedure script.

Declaration
public string GetCreateSPScript(string spName, string[] scriptPrefix, string[] scriptPostfix)
Parameters
Type Name Description
System.String spName

Name of the sp.

System.String[] scriptPrefix

The script prefix.

System.String[] scriptPostfix

The script postfix.

Returns
Type Description
System.String

GetHashCode()

Serves as a hash function for a particular type. System.Object.GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A hash code for the current System.Object.

Overrides
System.Object.GetHashCode()

Insert(Int32, Boolean)

Declaration
public SqlScript Insert(int index, bool value)
Parameters
Type Name Description
System.Int32 index
System.Boolean value
Returns
Type Description
SqlScript

Insert(Int32, Byte)

Declaration
public SqlScript Insert(int index, byte value)
Parameters
Type Name Description
System.Int32 index
System.Byte value
Returns
Type Description
SqlScript

Insert(Int32, Char)

Declaration
public SqlScript Insert(int index, char value)
Parameters
Type Name Description
System.Int32 index
System.Char value
Returns
Type Description
SqlScript

Insert(Int32, Char[])

Declaration
public SqlScript Insert(int index, char[] value)
Parameters
Type Name Description
System.Int32 index
System.Char[] value
Returns
Type Description
SqlScript

Insert(Int32, Char[], Int32, Int32)

Declaration
public SqlScript Insert(int index, char[] value, int startIndex, int charCount)
Parameters
Type Name Description
System.Int32 index
System.Char[] value
System.Int32 startIndex
System.Int32 charCount
Returns
Type Description
SqlScript

Insert(Int32, Decimal)

Declaration
public SqlScript Insert(int index, decimal value)
Parameters
Type Name Description
System.Int32 index
System.Decimal value
Returns
Type Description
SqlScript

Insert(Int32, Double)

Declaration
public SqlScript Insert(int index, double value)
Parameters
Type Name Description
System.Int32 index
System.Double value
Returns
Type Description
SqlScript

Insert(Int32, Int16)

Declaration
public SqlScript Insert(int index, short value)
Parameters
Type Name Description
System.Int32 index
System.Int16 value
Returns
Type Description
SqlScript

Insert(Int32, Int32)

Declaration
public SqlScript Insert(int index, int value)
Parameters
Type Name Description
System.Int32 index
System.Int32 value
Returns
Type Description
SqlScript

Insert(Int32, Int64)

Declaration
public SqlScript Insert(int index, long value)
Parameters
Type Name Description
System.Int32 index
System.Int64 value
Returns
Type Description
SqlScript

Insert(Int32, Object)

Declaration
public SqlScript Insert(int index, object value)
Parameters
Type Name Description
System.Int32 index
System.Object value
Returns
Type Description
SqlScript

Insert(Int32, Single)

Declaration
public SqlScript Insert(int index, float value)
Parameters
Type Name Description
System.Int32 index
System.Single value
Returns
Type Description
SqlScript

Insert(Int32, String)

Declaration
public SqlScript Insert(int index, string value)
Parameters
Type Name Description
System.Int32 index
System.String value
Returns
Type Description
SqlScript

Insert(Int32, String, Int32)

Declaration
public SqlScript Insert(int index, string value, int count)
Parameters
Type Name Description
System.Int32 index
System.String value
System.Int32 count
Returns
Type Description
SqlScript

Remove(Int32, Int32)

Declaration
public SqlScript Remove(int startIndex, int length)
Parameters
Type Name Description
System.Int32 startIndex
System.Int32 length
Returns
Type Description
SqlScript

Replace(Char, Char)

Declaration
public SqlScript Replace(char oldChar, char newChar)
Parameters
Type Name Description
System.Char oldChar
System.Char newChar
Returns
Type Description
SqlScript

Replace(Char, Char, Int32, Int32)

Declaration
public SqlScript Replace(char oldChar, char newChar, int startIndex, int count)
Parameters
Type Name Description
System.Char oldChar
System.Char newChar
System.Int32 startIndex
System.Int32 count
Returns
Type Description
SqlScript

Replace(String, String)

Declaration
public SqlScript Replace(string oldValue, string newValue)
Parameters
Type Name Description
System.String oldValue
System.String newValue
Returns
Type Description
SqlScript

Replace(String, String, Int32, Int32)

Declaration
public SqlScript Replace(string oldValue, string newValue, int startIndex, int count)
Parameters
Type Name Description
System.String oldValue
System.String newValue
System.Int32 startIndex
System.Int32 count
Returns
Type Description
SqlScript

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

Implements

System.IDisposable