From bbe816541bbbd72c97f9b512f905315aa72ae6df Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 24 Dec 2022 17:45:30 +0800 Subject: [PATCH] Synchronization code --- .../SqlServer/SqlBuilder/SqlServerBuilder.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerBuilder.cs b/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerBuilder.cs index 51fbbf41b..ef9c12607 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerBuilder.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerBuilder.cs @@ -11,5 +11,15 @@ namespace SqlSugar { public override string SqlTranslationLeft { get { return "["; } } public override string SqlTranslationRight { get { return "]"; } } + + public override string RemoveParentheses(string sql) + { + if (sql.Contains("ORDER BY")) + { + sql = $"SELECT * FROM {sql.Replace("(SELECT ", "(SELECT TOP 1000000")} TEMP"; + } + return sql; + } + } }