תÔØ×Ô£ºhttp://sunfreesky.blog.163.com/blog/static/211116820097224822596/
SQLServer°²×°³ÌÐòÅäÖ÷þÎñÆ÷ʧ°Ü.²Î¿¼·þÎñÆ÷´íÎóÈÕÖ¾ºÍc:\windows\sqlstp.logÁ˽â¸ü¶àÐÅÏ¢”´íÎó
2007Äê07ÔÂ15ÈÕ ÐÇÆÚÈÕ 16:25
SQL 2000 °²×°³ÌÐòÅäÖ÷þÎñÆ÷ʧ°Ü½â¾ö·½·¨£º
ÈÕÖ¾ÎļþÒýÓÃÄÚÈÝ£º
13:09:40 Process Exit Code: (-1)
13:10:45 °²×°³ÌÐòÅäÖ÷þÎñÆ÷ʧ°Ü¡£²Î¿¼·þÎñÆ÷´íÎóÈÕÖ¾ºÍ C:\WINDOWS\sqlstp.log Á˽â¸ü¶àÐÅÏ¢¡£
13:10:45 Action CleanUpInstall:
13:10:45 C:\WINDOWS\TEMP\SqlSetup\Bin\scm.exe -Silent 1 -Action 4 -Service SQLSERVERAGENT
13:10:46 Process Exit Code: (1060) Ö¸¶¨µÄ·þÎñ²¢Î´ÒÔÒÑ°²×°µÄ·þÎñ´æÔÚ¡£
13:10:46 C:\WINDOWS\TEMP\SqlSetup\Bin\scm.exe -Silent 1 -Action 4 -Service MSSQLSERVER
13:10:47 Process Exit Code: (0)
13:10:47 StatsGenerate returned: 2
13:10:47 StatsGenerate (0x80000000,0x1,0xf000000,0x200,2052,303,0x0,0x1,0,0,0
13:10:47 StatsGenerate -1,Alvin)
13:10:47 Installation Failed.13:09:40 Process Exit Cod ......
ÔÚwindows 7 ÉÏΪ sqlserver 2008 ÆôÓÃÔ¶³Ì·ÃÎÊ£¬ÐèÒªÁ½¸öÖصãµÄ²½Öè¡£
µÚÒ»²½£ºÆôÓÃsqlserver 2008Ô¶³Ì·ÃÎʵŦÄÜ¡£
´ò¿ªMicrosoft SQL Server 2008-ÅäÖù¤¾ß-SQL Server ÅäÖùÜÀíÆ÷
ÆôÓò¢¼¤»îTcp/IP
È»ºóÖØÆôsqlserver·þÎñ¡£ÕâÑùsqlserver 2008¾Í¿ÉÒÔ½øÐÐÔ¶³ÌÁ¬½ÓÁË¡£µ«ÊÇwin7 ·À»ðǽĬÈÏÊÇ×èÖ¹ÁËsqlsever ¿ª·¢µÄ¶Ë¿Ú£¬ËùÒÔ½ÓÏÂÀ´ÎÒÃÇÒª¸ü¸Äwin7 ·À»ðǽµÄÉèÖÃ.
µÚ¶þ²½£º¸ü¸Äwin7 ·À»ðǽµÄÉèÖá£
½øÈë“¿ØÖÆÃæ°å\ϵͳºÍ°²È«\Windows ·À»ðǽ”£¬Ñ¡Ôñ"¸ß¼¶ÉèÖÃ"
ÔÚÈëÕ¾¹æÔòÉÏн¨"Tcp 1433"ºÍ"Udp 1434"µÄÈëÕ¾¹æÔò¡£
......
sqlserver µÄntextÀàÐÍÔÚÊý¾Ý¿âÖÐÊÇ¿´²»µ½ÖµµÄ
Æð³õÎÒ»¹ÒÔΪÊý¾ÝûÓвåÈ룬ºóÀ´²ÅÖªµÀntextÀàÐÍÔÚÊý¾Ý¿âÖб¾À´¾Í¿´²»µ½µÄ£¨Êý¾Ý½Ï¶ÌµÄ¿ÉÒÔ¿´µ½£©£»
ÄÇÎÒÒªÏë¿´µ½ntextÊý¾ÝÔõô°ì£¿
ÔÚ²éѯ·ÖÎöÆ÷ÖпÉÒÔ¿´µ½£¨²éѯ·ÖÎöÆ÷ÖÐÒ²Ö»¿´µ½ÁËÇ°¼¸Ê®¸ö×Ö·û£¬¡¡²»ÊÇÈ«²¿µÄ£© ......
SQLServer ÅúÁ¿²åÈëÊý¾ÝµÄÁ½ÖÖ·½·¨
2009-07-27 19:31
ÔÚSQL Server ÖвåÈëÒ»ÌõÊý¾ÝʹÓÃInsertÓï¾ä£¬µ«ÊÇÈç¹ûÏëÒªÅúÁ¿²åÈëÒ»¶ÑÊý¾ÝµÄ»°£¬Ñ»·Ê¹ÓÃInsert²»½öЧÂʵͣ¬¶øÇһᵼÖÂSQLһϵͳÐÔÄÜÎÊÌâ¡£ÏÂÃæ½éÉÜSQL ServerÖ§³ÖµÄÁ½ÖÖÅúÁ¿Êý¾Ý²åÈë·½·¨£ºBulkºÍ±íÖµ²ÎÊý(Table-Valued Parameters)¡£
ÔËÐÐÏÂÃæµÄ½Å±¾£¬½¨Á¢²âÊÔÊý¾Ý¿âºÍ±íÖµ²ÎÊý¡£
´úÂëÈçÏÂ:
--Create DataBase
create database BulkTestDB;
go
use BulkTestDB;
go
--Create Table
Create table BulkTestTable(
Id int primary key,
UserName nvarchar(32),
Pwd varchar(16))
go
--Create Table Valued
CREATE TYPE BulkUdt AS TABLE
(Id int,
UserName nvarchar(32),
Pwd varchar(16))
ÏÂÃæÎÒÃÇʹÓÃ×î¼òµ¥µÄInsertÓï¾äÀ´²åÈë100ÍòÌõÊý¾Ý£¬´úÂëÈçÏ£º
´úÂëÈçÏÂ:
Stopwatch sw = new Stopwatch();
SqlConnection sqlConn = new SqlConnection(
ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);//Á¬½ÓÊý¾Ý¿â
SqlCommand sqlComm = new SqlCommand();
sqlComm.CommandText = string.Format("insert into BulkT ......
ÓÃwindowsÕ˺Ż¹ÊÇ¿ÉÒԵǼµÄ¡£
²éÕÒÎÊÌâµÄ¹ý³Ì£º
µÚÒ»²½£º Æô¶¯ËùÓÐÓëSQLÓйصķþÎñ£¬ÎÊÌâÒÀ¾É£»
µÚ¶þ²½£º ²é¿´windows·À»ðǽ£¬±»Ä¬ÈÏÆô¶¯ÁË£¬²»Æô¶¯Ñ¡ÔñÏî±»Disabled¡£Á½¸öÌáʾ“ÓÉÓÚ°²È«¿¼ÂÇ,ijЩÉèÖÃÓÉ×é²ßÂÔ¿ØÖÆ”“Windows·À»ðǽÕýÔÚʹÓÃÄúµÄÓòÉèÖÔ£¬ÏÈÓÃgpedit.msc´ò×é²ßÂÔ±à¼Æ÷£¬»úËã»úÅäÖÃ--¹ÜÀíÄ£°å--ÍøÂç--ÍøÂçÁ¬½Ó--Windows·À»ðǽ--±ê×¼ÅäÖÃÎļþ£¬²é¿´Óұ߸÷Ñ¡ÏîÊôÐÔ£¬¶¼ÊÇδÅäÖÃ״̬£¬ÎÊÌâ²»ÔÚÕâÀï¡£
ÁíÍâÒ»¸öÌáʾÖÐÌáµ½ÓòÉèÖã¬ÓòÉèÖò»¿ÉÄܽûÓÃSQL Server,²¢ÇÒÎҲ鿴±¾µØ¿ª·Å¶Ë¿Ú£¨netstart -an£©£¬25£¬1433£¬1434¶¼ÊÇ¿ª·¢×´Ì¬¡£
ÔΣ¬»á²»»áÊÇÃÜÂë´íÎó£¿
µÚÈý²½£ºÎÒÓÃwindowsÕ˺ŵǼ£¬Á¬½Ó³É¹¦ºó,, Ñ¡Ôñ"ÊôÐÔ"£¬
ÓÒ¼üʵÀý£¬ÔÚ"ÊôÐÔ"´°¿ÚÖÐ, תµ½"Security"(°²È«ÐÔ)Ïî, ²é¿´"·þÎñÆ÷Éí·ÝÑéÖ¤"ÖÐÉèÖÃȷΪ"SQL ServerºÍWindowsÉí·ÝÑé֤ģʽ",
È»ºóÖ´ÐÐÏÂÃæµÄÓï¾äÆôÓÃsaÓû§, ͬʱ¸ü¸ÄsaµÄÃÜÂë
EXEC sp_password 'sa',null,'sa'
ALTER LOGIN sa ENABLE
Ö´Ðгö´í£º
ÏûÏ¢ 15116£¬¼¶±ð 16£¬×´Ì¬ 1£¬µÚ 1 ÐÐ
ÃÜÂëÓÐЧÐÔÑé֤ʧ°Ü¡£¸ÃÃÜÂëÌ«¶Ì£¬²»·ûºÏ Windows ²ßÂÔÒªÇó¡£
¹þ¹þ£¬ÎÊÌâÕÒµ½¡£
±¾µØÉèÖÿÉÄܱ»ÓòÉèÖø²¸Ç¡£¶øÓ ......
UnionĬÈÏÊDz»ÄÜÓÐorder by×Ó¾ä
Èç¹ûÐèÒªÅÅÐò£¬ÔòÖ»ÄÜÈçÏÂʵÏÖ
select * from (select top 100 PERCENT * from ±íÃû order by ×Ö¶ÎÃû) a
union all
select * from (select top 100 PERCENT * from ±íÃû order by ×Ö¶ÎÃû) b ......