当使用Trusted_Connection =真和SQL Server身份验证,将这种影响的表现? [英] When using Trusted_Connection=true and SQL Server authentication, will this effect performance?
问题描述
如果一个连接字符串指定 Trusted_Connection = TRUE
与SQL Server身份验证模式,将我的web应用程序的性能会受到影响?
If a connection string specifies Trusted_Connection=true
with SQL Server authentication mode, will performance of my web application be impacted?
推荐答案
不是100%肯定你的意思:
Not 100% sure what you mean:
Trusted_Connection=True;
是使用Windows凭据,相当于100%:
IS using Windows credentials and is 100% equivalent to:
Integrated Security=SSPI;
或
Integrated Security=true;
如果你不想使用集成安全性/信任的连接,则需要在连接字符串中明确指定用户ID和密码(与遗漏任何引用 Trusted_Connection
或集成安全性
)
If you don't want to use integrated security / trusted connection, you need to specify user id and password explicitly in the connection string (and leave out any reference to Trusted_Connection
or Integrated Security
)
server=yourservername;database=yourdatabase;user id=YourUser;pwd=TopSecret
只有在这种情况下,SQL Server验证模式用于
Only in this case, the SQL Server authentication mode is used.
如果任这两个设置是present( Trusted_Connection = TRUE
或集成安全性=真/ SSPI
),然后在的Windows当前用户的凭据被用来进行身份验证对SQL Server和任何用户ID =
设置将被忽略和不可以使用。
If any of these two settings is present (Trusted_Connection=true
or Integrated Security=true/SSPI
), then the Windows credentials of the current user are used to authenticate against SQL Server and any user iD=
setting will be ignored and not used.
有关参考,请参阅连接字符串网站的SQL Server 2005,有很多实例和解释的。
For reference, see the Connection Strings site for SQL Server 2005 with lots of samples and explanations.
使用Windows身份验证的preferred和处事推荐的方式,但它可能会产生轻微的延迟,因为SQL服务器都进行身份验证对Active Directory(典型值)的凭据。我不知道这有多轻微的延迟可能是,我还没有找到任何引用了点。
Using Windows Authentication is the preferred and recommended way of doing things, but it might incur a slight delay since SQL Server would have to authenticate your credentials against Active Directory (typically). I have no idea how much that slight delay might be, and I haven't found any references for that.
综上:
如果您指定 Trusted_Connection = TRUE;
或集成安全性= SSPI;
或集成安全性= TRUE;
在连接字符串
If you specify either Trusted_Connection=True;
or Integrated Security=SSPI;
or Integrated Security=true;
in your connection string
==> ,然后(只有这样),你的 Windows身份验证发生。任何用户ID =
连接字符串中的设定将被忽略
==> THEN (and only then) you have Windows Authentication happening. Any user id=
setting in the connection string will be ignored.
如果您不要请指定这些设置,
If you DO NOT specify either of those settings,
==>那么您不要有Windows身份验证发生(SQL认证模式将被使用)
==> then you DO NOT have Windows Authentication happening (SQL Authentication mode will be used)
这篇关于当使用Trusted_Connection =真和SQL Server身份验证,将这种影响的表现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!