Skip to content

Instantly share code, notes, and snippets.

@LinZap
Created March 2, 2023 08:44
Show Gist options
  • Save LinZap/63ec2bbabca5a9972bb68d0a0583b665 to your computer and use it in GitHub Desktop.
Save LinZap/63ec2bbabca5a9972bb68d0a0583b665 to your computer and use it in GitHub Desktop.
SQL 優化成會根據 ConnectionString 動態填補缺少的設定

SQL 優化成會根據 ConnectionString 動態填補缺少的設定

版本:ZapLib v2.4.3

SQL 優化成會根據 ConnectionString 動態填補缺少的設定,已經指定於 ConnectionString 中的設定將不會被覆蓋 (例如 Connect Timeout)

使用範例

CASE 1

沒寫 Connect Timeout

Data Source=10.190.173.134\support6;Min Pool Size=0;Max Pool Size=100;
Pooling=true;Initial Catalog=Drive;
Persist Security Info=True;User ID=sa;Password=123456

ZapLib 自動補上

Data Source=10.190.173.134\support6;Min Pool Size=0;Max Pool Size=100;
Pooling=true;Initial Catalog=Drive;
Persist Security Info=True;User ID=sa;Password=123456;
Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;
ApplicationIntent=ReadWrite;MultiSubnetFailover=False

CASE 2

有寫 Connect Timeout

Data Source=10.190.173.134\support6;Min Pool Size=0;Max Pool Size=100;
Pooling=true;Initial Catalog=Drive;
Persist Security Info=True;User ID=sa;Password=123456;
Connect Timeout=999

ZapLib 照舊設定,其餘自動補上

Data Source=10.190.173.134\support6;Min Pool Size=0;Max Pool Size=100;
Pooling=true;Initial Catalog=Drive;
Persist Security Info=True;User ID=sa;Password=123456;
Connect Timeout=999;Encrypt=False;TrustServerCertificate=False;
ApplicationIntent=ReadWrite;MultiSubnetFailover=False

回 ZapLib v2.4.3 changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment