SQL SERVER 2005Ïà¹ØÎÊÌâ
Òѳɹ¦Óë·þÎñÆ÷½¨Á¢Á¬½Ó£¬µ«ÊÇÔڵǼǰµÄÎÕÊÖÆڼ䷢Éú´íÎóµÄ´¦Àí·½·¨
ÔÚÓÃSQL SERVER Óû§µÇ½SQL SERVER 2005ʱ£¬µ¯³öÒ»¸ö¶Ô»°¿ò£¬Ìáʾ" Òѳɹ¦Óë·þÎñÆ÷½¨Á¢Á¬½Ó£¬µ«ÊÇÔڵǼǰµÄÎÕÊÖÆڼ䷢Éú´íÎó",²éÕÒÁËÒ»ÏÂÔÒò£¬ÔÀ´ÊÇSQL SERVER 2005ʱ½ûÓÃTCP/IPµÇ½ÁË£¬´ò¿ªSQL SERVER 2005²Ëµ¥ÖеÄÅäÖù¤¾ßϵÄSQL SERVER Configuration Manager.µã»÷´°ÌåÖУ¬´ò¿ªSQL SERVER 2005 ÍøÂçÅäÖõÄϽڵ㣬ѡÔñMSSQLSERVERµÄÐÒé¡£°ÑÓұߴ°¿ÚµÄTCP/IPµÄÊôÐÔÒѽûÓ㬸ÄΪÒÑÆôÓ㬾ÍOKÁË¡£
ÔÚ½¨Á¢Óë·þÎñÆ÷µÄÁ¬½Óʱ³ö´í¡£ÔÚÁ¬½Óµ½ SQL Server 2005 ʱ£¬ÔÚĬÈϵÄÉèÖÃÏ SQL Server ²»ÔÊÐí½øÐÐÔ¶³ÌÁ¬½Ó¿ÉÄܻᵼÖ´Ëʧ°Ü¡£ (provider: ÃüÃû¹ÜµÀÌṩ³ÌÐò, error: 40 - ÎÞ·¨´ò¿ªµ½ SQL Server µÄÁ¬½Ó)
1. Êý¾Ý¿âÒýÇæûÓÐÆô¶¯¡£
ÓÐÁ½ÖÖÆô¶¯·½Ê½:
(1)¿ªÊ¼->³ÌÐò->Microsoft SQL Server 2005->SQL Server 2005ÍâΧӦÓÃÅäÖÃÆ÷,ÔÚ´ò¿ªµÄ½çÃæµ¥»÷"·þÎñµÄÁ¬½ÓµÄÍâΧӦÓÃÅäÖÃÆ÷",ÔÚ´ò¿ªµÄ½çÃæÖÐÕÒµ½Database Engine,µ¥»÷"·þÎñ",ÔÚÓÒ²à²é¿´ÊÇ·ñÒÑÆô¶¯,Èç¹ûûÓÐÆô¶¯¿Éµ¥»÷"Æô¶¯",²¢È·±£"Æô¶¯ÀàÐÍ"Ϊ×Ô¶¯,²»ÒªÎªÊÖ¶¯,·ñÔòÏ´οª»úʱÓÖÒªÊÖ¶¯Æô¶¯;
(2)¿É´ò¿ª:¿ªÊ¼->³ÌÐò->Microsoft SQL Server 2005->ÅäÖù¤¾ß->SQL Server Configuration Manager,Ñ¡ÖÐSQL Server 2005·þÎñÖÐSQL Server(MSSQLSERVER) ,²¢µ¥»÷¹¤¾ßÀ¸ÖеÄ"Æô¶¯·þÎñ"°´Å¥°Ñ·þÎñ״̬¸ÄΪÆô¶¯;
ʹÓÃÉÏÃæÁ½ÖÖ·½Ê½Ê±,ÓÐʱºòÔÚÆô¶¯µÄʱºò¿ÉÄÜ»á³öÏÖ´íÎó,²»ÄÜÆô¶¯,Õâʱ¾ÍÒª²é¿´"SQL Server 2005ÅäÖùÜÀíÆ÷"ÖеÄSQL Server 2005ÍøÂçÅäÖÃ->MSSQLSERVERÐÒéÖеÄVIAÊÇ·ñÒÑÆôÓÃ,Èç¹ûÒÑÆôÓÃ,Ôò°ÑËü½ûÖ¹.È»ºóÔÙÖ´ÐÐÉÏÊöÒ»ÖÖ·½Ê½²Ù×÷¾Í¿ÉÒÔÁË.
2. ÊÇ·ñÒѾÔÊÐíÔ¶³ÌÁ¬½Ó¡£
Õâ¸ö²¿·Ö¿ÉÒÔ¼òµ¥µÄ·ÖΪ4¸ö·½Ã棬·Ö±ðÊÇÔÚ SQL ServerÉÏÆôÓÃÔ¶³ÌÁ¬½Ó¡¢ÆôÓÃSQL Server ä¯ÀÀ·þÎñ¡¢ÔÚWindows ·À»ðǽÖÐΪSQL Server 2005 ´´½¨ÀýÍâºÍÔÚWindows ·À»ðǽÖÐΪ“SQLBrowser”´´½¨ÀýÍâ¡£ÏÂÃæÊǼ¸¸ö¾ßÌåµÄ²Ù×÷·½Ê½£¬Õª×ÔMSDN£¬¸öÈ˾õµÃÎÄÕµĺÚÌ岿·ÖÓ¦µ±ÌرðµÄÒ»ÆðÎÒÃǵÄ×¢Òâ¡£
ÔÚSQLServer ʵÀýÉÏÆôÓÃÔ¶³ÌÁ¬½Ó
1.Ö¸Ïò“¿ªÊ¼->³ÌÐò->Microsoft SQL Server 2005->ÅäÖù¤¾ß->SQL Server ÍâΧӦÓÃÅäÖÃÆ÷”
2.ÔÚ“SQL Server 2005 ÍâΧӦÓÃÅäÖÃÆ÷”Ò³, µ¥»÷“·þÎñºÍÁ¬½ÓµÄÍâΧӦÓÃÅäÖÃÆ÷”
3.È»ºóµ¥»÷Õ¹¿ª“Êý¾Ý¿
Ïà¹ØÎĵµ£º
½«ExcelÎļþÊý¾Ý¿âµ¼ÈëSQL ServerµÄÈýÖÖ·½°¸
//·½°¸Ò»£º ͨ¹ýOleDB·½Ê½»ñÈ¡ExcelÎļþµÄÊý¾Ý£¬È»ºóͨ¹ýDataSetÖÐתµ½SQL Server
openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "Excel files(*.xls)|*.xls";
if(openFileDialog.ShowDialog()==DialogResult.OK)
{
FileInfo ......
http://hi.baidu.com/dumao/blog/item/1cafa71e5886d019413417e4.html
1.È«ÎÄË÷Òý¸ÅÊö
¶Ô Microsoft® SQL Server™ 2000 Êý¾ÝµÄÈ«ÎÄÖ§³ÖÉæ¼°Á½¸ö¹¦ÄÜ£º¶Ô×Ö·ûÊý¾Ý·¢³ö²éѯµÄÄÜÁ¦ºÍ´´½¨¼°Î¬»¤»ù´¡Ë÷ÒýÒÔ¼ò»¯ÕâЩ²éѯµÄÄÜÁ¦¡£
È«ÎÄË÷ÒýÔÚÐí¶àµØ·½ÓëÆÕͨµÄ SQL Ë÷Òý²»Í¬¡£
ÆÕͨ SQL Ë÷ÒýÈ«ÎÄË÷Òý
´æ´¢Ê±ÊÜ ......
1¡¢Î½´Ê ν´ÊÔÊÐíÄú¹¹ÔìÌõ¼þ£¬ÒÔ±ãÖ»´¦ÀíÂú×ãÕâЩÌõ¼þµÄÄÇЩÐС£
2¡¢Ê¹Óà IN ν´Ê
ʹÓà IN ν´Ê½«Ò»¸öÖµÓëÆäËû¼¸¸öÖµ½øÐбȽϡ£ÀýÈ磺
SELECT NAME from STAFF WHERE DEPT IN (20, 15)
´ËʾÀýÏ൱ÓÚ£º
SELECT NAME from STAFF WHERE DEPT = 20 OR DEPT = 15
µ±×Ó²éѯ·µ»ØÒ»×éֵʱ£¬¿ÉʹÓà IN ºÍ NOT IN ÔËËã·û¡£ÀýÈç£ ......
µ÷Óà MS SQL ±êÁ¿Öµº¯Êý£¬Ó¦¸ÃÔÚº¯ÊýÇ°Ãæ¼ÓÉÏ "dbo."£¬·ñÔò»á±¨ “²»ÊÇ¿ÉÒÔʶ±ðµÄ ÄÚÖú¯ÊýÃû³Æ”´íÎó¡£ÀýÈç
DECLARE @WhichDB TINYINT;
SELECT @WhichDB = user_GetWhichDB(1);--¿´¿´ÊÇÄĸöÊý¾Ý¿âµÄ
=================================================
-- ......