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

SQL Server Á¬½Ó×Ö·û´®ºÍÉí·ÝÑéÖ¤

SQL Server .NET Data Provider Á¬½Ó×Ö·û´®°üº¬Ò»¸öÓÉһЩÊôÐÔÃû/Öµ¶Ô×é³ÉµÄ¼¯ºÏ¡£Ã¿Ò»¸öÊôÐÔ/Öµ¶Ô¶¼ÓɷֺŸô¿ª¡£
         PropertyName1=Value1;PropertyName2=Value2;PropertyName3=Value3;.....
ͬÑù£¬Á¬½Ó×Ö·û´®±ØÐë°üº¬SQL ServerʵÀýÃû³Æ:
         Data Source=ServerName;
         Ê¹Óñ¾µØµÄSQL Server(localhost)£¬Èç¹ûÏëҪʹÓÃÔ¶³Ì·þÎñÆ÷ÔËÐУ¬Ó¦¸ÃÔÚʾÀý¶ÔÏóÖаÑÕýÈ·µÄ·þÎñÆ÷¸³¸øData Source ÊôÐÔ¡£´ËÍ⣬»¹±ØÐëÖ¸¶¨ËùÖ§³ÖµÄÁ½ÖÖÉí·ÝÑéÖ¤·½·¨(¼´WindowsÉí·ÝÑéÖ¤ºÍSQL ServerÉí·ÝÑéÖ¤)ÖеÄÆäÖÐÒ»ÖÖ¡£WindowsÉí·ÝÑé֤ʹÓÃWindowsµÇ¼Óû§Éí·ÝÁ¬½ÓÊý¾Ý¿â£¬¶øSQLÉí·ÝÑéÖ¤ÒªÇóÏÔʽµØÖ¸¶¨SQL ServerÓû§IDºÍÃÜÂë¡£ÒªÏëʹÓÃWindowsÉí·ÝÑéÖ¤£¬±ØÐëÔÚÁ¬½Ó×Ö·û´®ÖаüÀ¨ Integrated Security ÊôÐÔ:
         Data Source=ServerName;Integrated Security=True;
         Ä¬ÈÏÇé¿öÏ£¬Integrated Security ÊôÐÔΪ False £¬ÕâÒâζ׎«½ûÓÃWindowsÉí·ÝÑéÖ¤¡£Èç¹ûûÓÐÏÔʽµØ°ÑÕâ¸öÊôÐÔµÄÖµÉèÖÃΪTrue£¬Á¬½Ó½«Ê¹ÓÃSQL ServerÉí·ÝÑéÖ¤£¬Òò´Ë£¬±ØÐëÌṩSQL ServerÓû§IDºÍÃÜÂë¡£Integrated SecurityÊôÐÔ»¹ÄÜʶ±ðµÄÆäËûÖµÖ»ÓÐSSPI(Security Support Provider Interface£¬°²È«ÐÔÖ§³ÖÌṩÕß½Ó¿Ú).ÔÚËùÓеÄWindows NT²Ù×÷ϵͳÉÏ£¬ÆäÖаüÀ¨Windows NT 4.0¡¢2000¡¢XP£¬¶¼Ö§³ÖÖµSSPI¡£ËüÊÇʹÓÃWindowsÉí·ÝÑé֤ʱ¿ÉÒÔʹÓõÄΩһ½Ó¿Ú£¬Ï൱ÓÚ°ÑIntegrated Security ÊôÐÔÖµÉèÖÃΪTrue¡£
         ÔÚWindowsÉí·ÝÑé֤ģʽÖУ¬SQL ServerʹÓÃWindowsµÄ°²È«×Óϵͳ¶ÔÓû§Á¬½Ó½øÐÐÓÐЧÐÔÑéÖ¤¡£¼´Ê¹ÏÔʾµØÖ¸¶¨Óû§IDºÍÃÜÂ룬SQL ServerÒ²²»¼ì²éÁ¬½Ó×Ö·û´®ÖеÄÓû§IDºÍÃÜÂë¡£ÒòΪֻÓÐWindows NT¡¢2000¡¢XPÖ§³ÖSSPI£¬Òò´ËÈç¹ûÕýʹÓõÄÊÇÕâЩ²Ù×÷ϵͳ£¬ÔòÖ»ÄÜʹÓÃWindows¼¯³ÉµÄ°²È«²ßÂÔÈ¥Á¬½ÓSQL Server¡£²»ÂÛʹÓÃÄÄÒ»¸ö²Ù×÷ϵͳ£¬µ±Ê¹ÓÃSQL ServerÉí·ÝÑé֤ʱ£¬±ØÐëÔÚÁ¬½Ó×Ö·û´®ÖÐÖ¸¶¨Óû§IDºÍÃÜÂ룺
Data Source=ServerName;User ID=donaldx;Password=unbreakable
         Ä¬ÈÏÇé¿öÏ£¬SQL Server .NET Data ProviderÁ¬½ÓÖ¸¶¨


Ïà¹ØÎĵµ£º

sqlÓï¾ä²éѯÔõôÅжϲéѯ½á¹ûΪ¿Õ£¿

sqldataadapterÊʺÏÓÃÔÚ²éѯ½Ï¶à×Ö¶Îʱ.....
string sou = "select * from art where content like '%" + TextBox1.Text + "%'";
SqlDataAdapter da = new SqlDataAdapter(sou, conn);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].rows.count==0)
{
Response.Write("ûÓмǼ£¡");
}
else
{
......

SQL ServerÊý¾Ý¿âÊÂÎñÈÕÖ¾´æ´¢ÐòÁÐ

Èç¹ûÄãµÄÊý¾Ý¿âÔËÐÐÔÚÍêÕû»òÊÇÅúÁ¿ÈÕÖ¾»Ö¸´Ä£Ê½Ï£¬ÄÇôÄã¾ÍÐèҪʹÓÃ×÷Òµ(job)À´¶¨ÆÚ±¸·ÝÊÂÎñÈÕÖ¾£¬±£³ÖÄãµÄÊÂÎñÎļþ´óС´¦ÔÚÒ»¸ö¿É¹ÜÀíµÄ·¶Î§¡£µ±ÄãÐèÒª»¹Ô­ÊÂÎñÈÕ־ʱ£¬Äã¾ÍÐèÒª°´ÕÕ´´½¨ÊÂÎñÈÕÖ¾µÄ˳ÐòÀ´»Ö¸´ËüÃÇ¡£Äã¿ÉÒԲο¼´æÔÚmsdb..backupset±íÖеÄÐÅÏ¢À´È·¶¨»¹Ô­ÎļþµÄ˳Ðò£¬Ê¹ÓÃFirstLSNºÍLastLSNÁеÄÖµ×÷²Î¿¼¡£µ±Ä ......

SQL ServerÊý¾Ý¿âÊÂÎñÈÕÖ¾ÐòÁкÅ(LSN)½éÉÜ

  ÈÕÖ¾ÐòÁбàºÅ(LSN)ÊÇÊÂÎñÈÕÖ¾ÀïÃæÿÌõ¼Ç¼µÄ±àºÅ¡£
µ±ÄãÖ´ÐÐÒ»´Î±¸·Ýʱ£¬Ò»Ð©LSNÖµ¾Í±»Í¬Ê±´æ´¢ÔÚÎļþ±¾Éí¼°msdb..backupset±íÖС£Äã¿ÉÒÔʹÓÃRESTORE HEADERONLYÓï·¨À´´Ó±¸·ÝÎļþÖлñÈ¡LSNÖµ¡£
 
×¢Ò⣺ÔÚSQL Server 2000ÖУ¬ÓÐÒ»ÁнÐ×öDifferentialBaseLSN¡£µ«ÔÚSQL Server 2005ÖУ¬ÏàͬµÄÁÐÃû³Æ±ä³ÉÁËData ......

sqlÓï¾ä²éѯ½á¹ûºÏ²¢union ºÍunion allÓ÷¨

sqlÓï¾ä²éѯ½á¹ûºÏ²¢union ºÍunion allÓ÷¨
 
--ºÏ²¢Öظ´ÐÐ
select * from A
union
select * from B
--²»ºÏ²¢Öظ´ÐÐ
select * from A
union all
select * from B
°´Ä³¸ö×Ö¶ÎÅÅÐò
--ºÏ²¢Öظ´ÐÐ
select *
from (
select * from A
union
select * from B) AS T
order by ×Ö¶ÎÃû
--²»ºÏ²¢Öظ´ÐÐ
sel ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ