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

SQL ServerÖÐÔ¼ÊøµÄ½éÉÜ

ÕªÒª
¶ÔÓÚSQL ServerÖеÄÔ¼Êø£¬Ïë±Ø´ó¼Ò²¢²»ÊǺÜİÉú¡£µ«ÊÇÔ¼ÊøÖÐÕæÕýµÄÄÚº­ÊÇʲô£¬²¢²»ÊǺܶàÈ˶¼ºÜÇå³þµÄ¡£±¾ÎÄÒÔÏêϸµÄÎÄ×ÖÀ´½éÉÜÁËʲôÊÇÔ¼Êø£¬ÒÔ¼°ÈçºÎÔÚÊý¾Ý¿â±à³ÌÖÐÓ¦ÓúÍʹÓÃÕâÐ©Ô¼Êø£¬À´´ïµ½¸üºÃµÄ±à³ÌЧ¹û¡££¨±¾ÎIJ¿·ÖÄÚÈݲο¼ÁËSQL ServerÁª»úÊֲᣩ
ÄÚÈÝ
 
Êý¾ÝÍêÕûÐÔ·ÖÀà
 
ʵÌåÍêÕûÐÔ
 
ÓòÍêÕûÐÔ
 
ÒýÓÃÍêÕûÐÔ
 
Óû§¶¨ÒåÍêÕûÐÔ
 
PRIMARY KEYÔ¼Êø
 
DEFAULTÔ¼Êø
 
CHECKÔ¼Êø
 
UNIQUEÔ¼Êø
 
FOREIGN KEYÔ¼Êø
ÕýÎÄ
ÔÚÊý¾Ý¿â¹ÜÀíϵͳÖУ¬±£Ö¤Êý¾Ý¿âÖеÄÊý¾ÝÍêÕûÐÔÊǷdz£ÖØÒªµÄ¡£ËùνÊý¾ÝÍêÕûÐÔ£¬¾ÍÊÇÖ¸´æ´¢ÔÚÊý¾Ý¿âÖÐÊý¾ÝµÄÒ»ÖÂÐÔºÍÕýÈ·ÐÔ¡£Ô¼Êø¶¨Ò幨ÓÚÁÐÖÐÔÊÐíÖµµÄ¹æÔò£¬ÊÇÇ¿ÖÆÍêÕûÐԵıê×¼»úÖÆ¡£Ê¹ÓÃÔ¼ÊøÓÅÏÈÓÚʹÓô¥·¢Æ÷¡¢¹æÔòºÍĬÈÏÖµ¡£²éѯÓÅ»¯Æ÷ҲʹÓÃÔ¼Êø¶¨ÒåÉú³É¸ßÐÔÄܵIJéѯִÐмƻ®¡£
SQL ServerÁª»ú´ÔÊéÖУ¬½«Êý¾ÝÍêÕûÐÔ½âÊÍÈçÏ£º“´æ´¢ÔÚÊý¾Ý¿âÖеÄËùÓÐÊý¾ÝÖµ¾ùÕýÈ·µÄ״̬¡£Èç¹ûÊý¾Ý¿âÖд洢Óв»ÕýÈ·µÄÊý¾ÝÖµ£¬Ôò¸ÃÊý¾Ý¿â³ÆÎªÒÑɥʧÊý¾ÝÍêÕûÐÔ¡£”Ç¿ÖÆÊý¾ÝÍêÕûÐÔ¿ÉÈ·±£Êý¾Ý¿âÖеÄÊý¾ÝÖÊÁ¿¡£
ÀýÈ磬Èç¹ûÊäÈëÁË employee_id ֵΪ 123 µÄÖ°Ô±£¬ÄÇô¸ÃÊý¾Ý¿â²»Ó¦ÔÊÐíÆäËûְԱʹÓÃͬһ ID Öµ¡£Èç¹û¼Æ»®½« employee_rating ÁеÄÖµ·¶Î§É趨Ϊ´Ó 1 µ½ 5£¬ÔòÊý¾Ý¿â²»Ó¦½ÓÊÜ 6¡£Èç¹û±íÓÐÒ» dept_id ÁУ¬¸ÃÁд洢ְԱµÄ²¿ÃűàºÅ£¬ÔòÊý¾Ý¿âÓ¦Ö»ÔÊÐí½ÓÊܹ«Ë¾ÖеÄÓÐЧ²¿ÃűàºÅ¡£
Êý¾ÝÍêÕûÐÔ·ÖÀà
ÔÚSQL ServerÖУ¬¸ù¾ÝÊý¾ÝÍêÕûдëÊ©Ëù×÷ÓõÄÊý¾Ý¿â¶ÔÏóºÍ·¶Î§²»Í¬£¬¿ÉÒÔ½«Êý¾ÝÍêÕûÐÔ·ÖΪÒÔϼ¸ÖÖ¡£
 
ʵÌåÍêÕûÐÔ
 
ÓòÍêÕûÐÔ
 
ÒýÓÃÍêÕûÐÔ
 
Óû§¶¨ÒåÍêÕûÐÔ
SQL ServerÁª»ú´ÔÊéÖÐÖ¸Ã÷£º“¶Ô±í½øÐмƻ®ÓÐÁ½¸öÖØÒª²½Ö裺±êʶÁеÄÓÐЧֵºÍÈ·¶¨ÈçºÎÇ¿ÖÆÁÐÖеÄÊý¾ÝÍêÕûÐÔ¡£”
ʵÌåÍêÕûÐÔ
ʵÌåÍêÕûÐÔ¼òµ¥µÄ˵£¬¾ÍÊǽ«±íÖеÄÿһÐп´×÷Ò»¸öʵÌ塣ʵÌåÍêÕûÐÔÒªÇó±íµÄ±êʾ·ûÁлòÖ÷¼üµÄÍêÕûÐÔ¡£¿ÉÒÔͨ¹ý½¨Á¢Î¨Ò»Ë÷Òý¡¢PRIMARY KEYÔ¼Êø¡¢UNIQUEÔ¼Êø£¬ÒÔ¼°ÁеÄIDENTITYÊôÐÔÀ´ÊµÊ©ÊµÌåÍêÕûÐÔ¡£
ÓòÍêÕûÐÔ
ÓòÍêÕûÐÔÊÇÖ¸¸ø¶¨ÁеÄÊäÈëÓÐЧÐÔ¡£ÒªÇó±íÖÐÖ¸¶¨ÁеÄÊý¾Ý¾ßÓÐÕýÈ·µÄÊý¾ÝÀàÐÍ¡¢¸ñʽºÍÓÐЧµÄÊý¾Ý·¶Î§¡£Ç¿ÖÆÓòÓÐЧÐԵķ½·¨ÓУºÏÞÖÆÀàÐÍ£¨Í¨¹ýÊý¾ÝÀàÐÍ£©¡¢¸ñʽ£¨Í¨¹ý CHECK Ô¼ÊøºÍ¹æÔò£©»ò¿ÉÄÜÖµµÄ·¶Î§¡£ÓòÍêÕûÐÔͨ¹ý FOREIGN KEY Ô¼Êø¡¢CHECK Ô¼Êø¡¢DEFAULT ¶¨Òå¡¢NOT NULL ¶¨ÒåºÍ¹æÔòÀ´ÊµÏÖ¡£
ÒýÓÃÍêÕûÐÔ


Ïà¹ØÎĵµ£º

SQLÊý¾Ý¿â

l  ÔÚ³ÌÐòÖÐÆ´½ÓSQLÃüÁî
¿ÉÊÇÈçºÎÔÚC#³ÌÐòÖÐÔËÐÐÄØ£¿ÎÒÃǼǵÃÔÚÆÕͨµÄSQL²éѯÖУ¬Ò»°ãÐèÒª°Ñ²éѯÓï¾ä¸³Öµ¸øSalCommand.CommandTextÊôÐÔ£¬ÕâÀïÒ²¾ÍÏñÆÕͨµÄSQL²éѯÓï¾äÒ»Ñù£¬½«ÕâЩÓï¾ä¸³¸øSqlCommand.CommandTextÊôÐÔ¼´¿É¡£Òª×¢ÒâµÄÒ»µãÊÇ£¬ÆäÖеÄ"GO"Óï¾ä±êÖ¾×ÅSQLÅú´¦ÀíµÄ½áÊø£¬±àдSQL½Å±¾ÊÇÐèÒªµÄ£¬µ«ÊÇÔÚÕâÀïÊDz ......

ά»¤SQL serverµÄ28¸öСÎÊÌâ

1.ÈçºÎ´´½¨Êý¾Ý¿â
CREATE DATABASE student
2.ÈçºÎɾ³ýÊý¾Ý¿â
DROP DATABASE student
3.ÈçºÎ±¸·ÝÊý¾Ý¿âµ½´ÅÅÌÎļþ
BACKUP DATABASE student to disk=´c:S4.bak´
4.ÈçºÎ´Ó´ÅÅÌÎļþ»¹Ô­Êý¾Ý¿â
RESTORE DATABASE studnet from DISK = ´c:S4.bak´
5.ÔõÑù´´½¨±í£¿
CREATE TABLE Students (
&n ......

SQL SERVER 2005 »ù±¾²éѯ£¨Á¬½Ó²éѯ£©

use AdventureWorks
GO
SELECT c.LastName from Person.Contact c;
SELECT * from HumanResources.Employee e
INNER JOIN HumanResources.Employee m
 ON e.ManagerID = m.EmployeeID; n
SELECT ProductID,Name,ProductNumber,ReorderPoint
from Production.Product
where ProductID in( select ProductID fro ......

SQL SERVER 2005 ¸ß¼¶²éѯ£¨×Ó²éѯ²éѯ£©

--SQL¸ß¼¶³ÌÐòÉè¼Æ£º×Ó²éѯ
use AdventureWorks
GO
SELECT DISTINCT EmployeeID from HumanResources.JobCandidate WHERE EmployeeID IS NOT NULL;
SELECT e.EmployeeID,FirstName,LastName
from HumanResources.Employee e
INNER JOIN Person.Contact c
 ON e.ContactID = c.ContactID
WHERE e.EmployeeID IN ......

phpmyadmin ÐÞ¸ÄÖ´ÐÐsqlÎļþ´óСÏÞÖÆ

phpmyadmin ÐÞ¸ÄÖ´ÐÐsqlÎļþ´óСÏÞÖÆ
´ò¿ªphp.ini
post_max_size = 100M       ; ±íµ¥Ìá½»Îļþ´óСÉÏÏÞ
memory_limit = 128M    ; ÄÚ´æÉÏÏÞ
upload_max_filesize = 100M ; ÉÏ´«Îļþ´óСÉÏÏÞ
ÐÞ¸ÄÒÔÉÏÈýÏ¾Í¿ÉÒÔ½â¾ö¡£ µ«ÊÇ´ËʱPHPMYADMINÖÐ×î´óÏÞÖÆ£º22,528 KB£¬ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ