Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL ServerÁ¬½ÓÖеÄËĸö×î³£¼û´íÎó

SQL ServerÁ¬½ÓÖеÄËĸö×î³£¼û´íÎó:
Ò»."SQL Server ²»´æÔÚ»ò·ÃÎʱ»¾Ü¾ø"
Õâ¸öÊÇ×ÔÓµÄ,´íÎó·¢ÉúµÄÔ­Òò±È½Ï¶à,ÐèÒª¼ì²éµÄ·½ÃæÒ²±È½Ï¶à.
Ò»°ã˵À´,ÓÐÒÔϼ¸ÖÖ¿ÉÄÜÐÔ:
1,SQL ServerÃû³Æ»òIPµØַƴдÓÐÎó
2,·þÎñÆ÷¶ËÍøÂçÅäÖÃÓÐÎó
3,¿Í»§¶ËÍøÂçÅäÖÃÓÐÎó
Òª½â¾öÕâ¸öÎÊÌâ,ÎÒÃÇÒ»°ãÒª×ñÑ­ÒÔϵIJ½ÖèÀ´Ò»²½²½ÕÒ³öµ¼Ö´íÎóµÄÔ­Òò.
============= Ê×ÏÈ,¼ì²éÍøÂçÎïÀíÁ¬½Ó =============
ping <·þÎñÆ÷IPµØÖ·/·þÎñÆ÷Ãû³Æ>
Èç¹û ping <·þÎñÆ÷IPµØÖ·> ²»³É¹¦,˵Ã÷ÎïÀíÁ¬½ÓÓÐÎÊÌâ,ÕâʱºòÒª¼ì²éÓ²¼þÉ豸,ÈçÍø¿¨,HUB,·ÓÉÆ÷µÈ.
»¹ÓÐÒ»ÖÖ¿ÉÄÜÊÇÓÉÓÚ¿Í»§¶ËºÍ·þÎñÆ÷Ö®¼ä°²×°ÓзÀ»ðǽÈí¼þÔì³ÉµÄ,±ÈÈç ISA Server.·À»ðǽÈí¼þ¿ÉÄÜ»áÆÁ±Î¶Ô ping,telnet µÈµÄÏìÓ¦
Òò´ËÔÚ¼ì²éÁ¬½ÓÎÊÌâµÄʱºò,ÎÒÃÇÒªÏÈ°Ñ·À»ðǽÈí¼þÔÝʱ¹Ø±Õ,»òÕß´ò¿ªËùÓб»·â±ÕµÄ¶Ë¿Ú.
Èç¹ûping <·þÎñÆ÷IPµØÖ·> ³É¹¦¶ø,ping <·þÎñÆ÷Ãû³Æ> ʧ°Ü
Ôò˵Ã÷Ãû×Ö½âÎöÓÐÎÊÌâ,ÕâʱºòÒª¼ì²é DNS ·þÎñÊÇ·ñÕý³£.
ÓÐʱºò¿Í»§¶ËºÍ·þÎñÆ÷²»ÔÚͬһ¸ö¾ÖÓòÍøÀïÃæ,ÕâʱºòºÜ¿ÉÄÜÎÞ·¨Ö±½ÓʹÓ÷þÎñÆ÷Ãû³ÆÀ´±êʶ¸Ã·þÎñÆ÷,ÕâʱºòÎÒÃÇ¿ÉÒÔʹÓÃHOSTSÎļþÀ´½øÐÐÃû×Ö½âÎö,
¾ßÌåµÄ·½·¨ÊÇ:
1.ʹÓüÇʱ¾´ò¿ªHOSTSÎļþ£¨Ò»°ãÇé¿öÏÂλÓÚC:\WINNT\system32\drivers\etc£©.
Ìí¼ÓÒ»ÌõIPµØÖ·Óë·þÎñÆ÷Ãû³ÆµÄ¶ÔÓ¦¼Ç¼,Èç:
172.168.10.24 myserver
2.»òÔÚ SQL Server µÄ¿Í»§¶ËÍøÂçʵÓù¤¾ßÀïÃæ½øÐÐÅäÖÃ,ºóÃæ»áÓÐÏêϸ˵Ã÷.
============= Æä´Î,ʹÓà telnet ÃüÁî¼ì²éSQL Server·þÎñÆ÷¹¤×÷״̬ =============
telnet <·þÎñÆ÷IPµØÖ·> 1433
Èç¹ûÃüÁîÖ´Ðгɹ¦,¿ÉÒÔ¿´µ½ÆÁĻһÉÁÖ®ºó¹â±êÔÚ×óÉϽDz»Í£ÉÁ¶¯,Õâ˵Ã÷ SQL Server ·þÎñÆ÷¹¤×÷Õý³£,²¢ÇÒÕýÔÚ¼àÌý1433¶Ë¿ÚµÄ TCP/IP Á¬½Ó
Èç¹ûÃüÁî·µ»Ø"ÎÞ·¨´ò¿ªÁ¬½Ó"µÄ´íÎóÐÅÏ¢,Ôò˵Ã÷·þÎñÆ÷¶ËûÓÐÆô¶¯ SQL Server ·þÎñ,
Ò²¿ÉÄÜ·þÎñÆ÷¶ËûÆôÓà TCP/IP ЭÒé,»òÕß·þÎñÆ÷¶ËûÓÐÔÚ SQL Server ĬÈϵĶ˿Ú1433ÉϼàÌý.
=============½Ó×Å,ÎÒÃÇÒªµ½·þÎñÆ÷Éϼì²é·þÎñÆ÷¶ËµÄÍøÂçÅäÖÃ,¼ì²éÊÇ·ñÆôÓÃÁËÃüÃû¹ÜµÀ.ÊÇ·ñÆôÓÃÁË TCP/IP ЭÒéµÈµÈ =============
¿ÉÒÔÀûÓà SQL Server ×Ô´øµÄ·þÎñÆ÷ÍøÂçʹÓù¤¾ßÀ´½øÐмì²é.
µã»÷:³ÌÐò -- Microsoft SQL Server -- ·þÎñÆ÷ÍøÂçʹÓù¤¾ß
´ò¿ª¸Ã¹¤¾ßºó,ÔÚ"³£¹æ"ÖпÉÒÔ¿´µ½·þÎñÆ÷ÆôÓÃÁËÄÄЩЭÒé.
Ò»°ã¶øÑÔ,ÎÒÃÇÆôÓÃÃüÃû¹ÜµÀÒÔ¼° TCP/IP ЭÒé.
µãÖÐ TCP/IP ЭÒé,Ñ¡Ôñ"ÊôÐÔ",ÎÒÃÇ¿ÉÒÔÀ´¼ì²é SQK Server ·þÎñĬÈ϶˿ڵÄÉèÖÃ
Ò»°ã¶øÑÔ,Î


Ïà¹ØÎĵµ£º

SQL ·À×¢Èëʽ¹¥»÷

1¡¢¼ì²éÊÇ·ñÓзǷ¨×Ö·û
public static boolean sql_inj(String str)
{
    String inj_str = "'|and|exec|insert|select|delete|update|
count|*|%|chr|mid|master|truncate|char|declare|;|or|-|+|,";
//ÕâÀïµÄ¶«Î÷»¹¿ÉÒÔ×Ô¼ºÌí¼Ó
String[] inj_stra=inj_str.split("\\|");
    for ......

asp.net(c#) ÏÂSQL´æ´¢¹ý³ÌʹÓÃÏêϸʵÀý

¼ÇÈ¡¼Ç¼¼¯
create procedure getArticle
as
select * from Article_Content
GO
asp.net µ÷Ó÷½·¨
  SqlConnection Conn = new SqlConnection();
        Conn.ConnectionString = Data.Connstr();
        Conn.Open();
  ......

sql Çø¼äʱ¼äÅжÏ

[code]declare @startdt datetime
declare @enddt datetime
select @startdt='2009-12-03',@enddt='2009-12-05'
select * from tb
where ¿ªÊ¼ÈÕÆÚ between @startdt and @enddt
or ½áÊøÈÕÆÚ between @startdt and @enddt
or @startdt between ¿ªÊ¼ÈÕÆÚ and ½áÊøÈÕÆÚ
or @enddt between ¿ªÊ¼ÈÕÆÚ and ......

ʹÓÃsql_trace²é¿´sqlÐÔÄÜ

×÷Ϊһ¸öB/S¿ª·¢Õߣ¬»ò¶à»òÉÙ¶¼µÃºÍÊý¾Ý¿â´ò½»µÀ£¬¶ø¶ÔÊý¾Ý¿âµÄ²Ù×÷¹é¸ùµ½µ×¶¼ÊÇqueryÓï¾ä£¬ËùÓе½×îºó¶¼ÊÇΪÁ˲éѯ£¬ÄÇô²é¿´sqlÐÔÄÜÓÖ³ÉÁËÎÒÃÇ¿ª·¢ÖеÄÒ»¼þȤÊ¡£ÏÂÃæ¼òµ¥½éÉÜÏÂsql_traceµÄʹÓãº
alter session set sql_trace =true ;--´ò¿ªsql_trace
select * from (select * from t order by id) where rownum <= ......

SQL£­²éѯËùÓд¥·¢Æ÷

----²é¿´ËùÓнDZ¾
Create table #y (txt text)
select name, iid = identity(int,1,1) into #x from SysObjects where xtype = 'TR'
declare @i int, @max int
declare @name varchar(40)
set @i = 1
select @max = max(iid) from #x
while @i <= @max
begin
    select @name = name from #x w ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ