ScriptResultAsCreateTable() public method

public ScriptResultAsCreateTable ( int resultIndex, string tableName ) : string
resultIndex int
tableName string
return string
コード例 #1
0
        private static void renderSchemaAndData(FlexResultSet resultSet, SqlRunParameters srp)
        {
            var sb = srp.resultsText;

            for (int i = 0; i < resultSet.results.Count; i++)
            {
                if (resultSet.results[i].recordsAffected > 0)
                {
                    sb.AppendLine(String.Format("--Records affected: {0:G}\r\n\r\n", resultSet.results[i].recordsAffected));
                }
                string resultTableName = "#Result" + (i + 1 + srp.completedResultsCount).ToString();
                sb.AppendLine(resultSet.ScriptResultAsCreateTable(i, resultTableName));
                sb.Append("\r\n");

                if (FieldScripting.ResultIsRenderableAsScriptedData(resultSet.results[i]))
                {
                    sb.AppendLine(FieldScripting.ScriptResultDataAsInsert(resultSet.results[i], resultTableName, FlexResultSet.SQL2008MaxRowsInValuesClause).ToString());
                }

                srp.completedResultsCount += 1;

                sb.Append("\r\n");
            }
        }
コード例 #2
0
ファイル: QueryWorker.cs プロジェクト: nycdotnet/TSqlFlex
        private static void renderSchemaAndData(FlexResultSet resultSet, SqlRunParameters srp)
        {
            var sb = srp.resultsText;
            for (int i = 0; i < resultSet.results.Count; i++)
            {
                if (resultSet.results[i].recordsAffected > 0)
                {
                    sb.AppendLine(String.Format("--Records affected: {0:G}\r\n\r\n", resultSet.results[i].recordsAffected));
                }
                string resultTableName = "#Result" + (i + 1 + srp.completedResultsCount).ToString();
                sb.AppendLine(resultSet.ScriptResultAsCreateTable(i, resultTableName));
                sb.Append("\r\n");

                if (FieldScripting.ResultIsRenderableAsScriptedData(resultSet.results[i]))
                {
                    sb.AppendLine(FieldScripting.ScriptResultDataAsInsert(resultSet.results[i], resultTableName, FlexResultSet.SQL2008MaxRowsInValuesClause).ToString());
                }

                srp.completedResultsCount += 1;

                sb.Append("\r\n");
            }
        }