private void GivenSqlStream(string tsql)
 {
     byte[] sqlBytes = new UTF8Encoding().GetBytes(tsql);
     this.loader = new SqlScriptLoader(new StreamReader(new MemoryStream(sqlBytes)), true);
 }
        private string LoadScript(string fileName)
        {
            System.Text.Encoding readEncoding;
            if (this.CodePage > 0)
            {
                try
                {
                    readEncoding = System.Text.Encoding.GetEncoding(this.CodePage);
                }
                catch
                {
                    this.Log.LogError(string.Format(CultureInfo.CurrentCulture, "Invalid CodePage passed: {0}", this.CodePage));
                    throw;
                }
            }
            else
            {
                readEncoding = System.Text.Encoding.Default;
            }

            string retValue;
            using (StreamReader textFileReader = new StreamReader(fileName, readEncoding, true))
            {
                retValue = new SqlScriptLoader(textFileReader, this.StripMultiLineComments).ReadToEnd();
            }

            return retValue;
        }