SQL Server 2005 ³öÏÖµ½Ö÷»ú µÄ TCP/IP Á¬½Óʧ°Ü
ÓÃjdbcÁ¬½ÓSQL Server2005³öÏÖµ½Ö÷»ú µÄ TCP/IP Á¬½Óʧ°Ü¡£ java.net.ConnectException: Connection refused: connect!
¹À¼ÆÊÇÒòΪsqlserver2005ĬÈÏÇé¿öÏÂÊǽûÓÃÁËtcp/ipÁ¬½Ó¡£
Äú¿ÉÒÔÔÚÃüÁîÐÐÊäÈ룺telnet localhost 1433½øÐмì²é£¬Õâʱ»á±¨´í£ºÕýÔÚÁ¬½Óµ½localhost...²»ÄÜ´ò¿ªµ½Ö÷»úµÄÁ¬½Ó£¬ÔÚ¶Ë¿Ú 1433: Á¬½Óʧ°Ü
Æô¶¯tcp/ipÁ¬½ÓµÄ·½·¨£º
´ò¿ª \Microsoft SQL Server 2005\ÅäÖù¤¾ß\Ŀ¼ÏµÄSQL Server Configuration Manager£¬Ñ¡ÔñmssqlserverÐÒé, È»ºóÓұߴ°¿ÚÓиötcp/ipÐÒ飬ÉèÖÃip/allĬÈ϶˿ÚΪ1433£¬È»ºóÆô¶¯Ëü£¬ÖØÆôsqlserver·þÎñ¡£
ÎÊÌâ½â¾ö
ÕâʱÔÚÃüÁîÐÐÊäÈ룺telnet localhost 1433¾Í²»»áÔÙ±¨´íÁË£¬´°¿ÚÏÔʾΪһƬºÚ£¬¼´ÎªÕý³£
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/skyiceking/archive/2008/09/02/2867743.aspx
Ïà¹ØÎĵµ£º
1. ²é¿´ SQL 2005 Óû§ËùÊôÊý¾Ý¿â½ÇÉ«
use yourdb
go
select DbRole = g.name, MemberName = u.name, MemberSID = u.sid
from sys.database_principals u, sys.database_principals g, sys.database_role_members m
where g.principal_id = m.role_principal_id
and u.principal_id = m.member_principal_id
......
--Óû§Óë½ÇÉ«¹Øϵ
select a.uid as uid,a.status as uStatus,a.name as uName,
b.uid as rId,b.status as rStatus,b.name as rName
from sysusers a inner join sysusers b on a.gid = b.uid
where a.issqlrole = 0 and a.isapprole = 0 and a.hasdbaccess = 1 and (b.issqlrole = 1 or b.isapprole = 1)
......
Ò»¡¢ÉîÈëdz³öÀí½âË÷Òý½á¹¹
¡¡¡¡Êµ¼ÊÉÏ£¬Äú¿ÉÒÔ°ÑË÷ÒýÀí½âΪһÖÖÌØÊâµÄĿ¼¡£Î¢ÈíµÄSQL SERVERÌṩÁËÁ½ÖÖË÷Òý£º¾Û¼¯Ë÷Òý£¨clustered index£¬Ò²³Æ¾ÛÀàË÷Òý¡¢´Ø¼¯Ë÷Òý£©ºÍ·Ç¾Û¼¯Ë÷Òý£¨nonclustered index£¬Ò²³Æ·Ç¾ÛÀàË÷Òý¡¢·Ç´Ø¼¯Ë÷Òý£©¡£ÏÂÃ棬ÎÒÃǾÙÀýÀ´ËµÃ÷һϾۼ¯Ë÷ÒýºÍ·Ç¾Û¼¯Ë÷ÒýµÄÇø±ð£º
¡¡¡¡Æäʵ£¬ÎÒÃǵĺºÓï×Öµäµ ......
¸ÄÉÆSQLÓï¾ä
¡¡¡¡ºÜ¶àÈ˲»ÖªµÀSQLÓï¾äÔÚSQL SERVERÖÐÊÇÈçºÎÖ´Ðеģ¬ËûÃǵ£ÐÄ×Ô¼ºËùдµÄSQLÓï¾ä»á±»SQL SERVERÎó½â¡£±ÈÈ磺
select * from table1 where name=''zhangsan'' and tID > 10000
ºÍÖ´ÐÐ:
select * from table1 where tID > 10000 and name=''zhangsan''
¡¡¡¡Ò»Ð©È˲»ÖªµÀÒÔÉÏÁ½ÌõÓï¾äµÄÖ´ÐÐЧÂÊÊÇ·ñÒ» ......