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

SQL ³£ÓÃµÄ Ôö¡¢É¾¡¢¸Ä¡¢²é »¹ÊÇÀμÇÓÚÐÄ àÞ

¼¸¸ö¼òµ¥µÄ»ù±¾µÄsqlÓï¾ä
 
Ñ¡Ôñ£ºselect * from table1 where ·¶Î§
²åÈ룺insert into table1(field1,field2) values(value1,value2)
ɾ³ý£ºdelete from table1 where ·¶Î§
¸üУºupdate table1 set field1=value1 where ·¶Î§
²éÕÒ£ºselect * from table1 where field1 like ’%value1%’
ÅÅÐò£ºselect * from table1 order by field1,field2 [desc]
×ÜÊý£ºselect count ( *)   as totalcount from table1
ÇóºÍ£ºselect sum(field1) as sumvalue from table1
ƽ¾ù£ºselect avg(field1) as avgvalue from table1
×î´ó£ºselect max(field1) as maxvalue from table1
×îС£ºselect min(field1) as minvalue from table1
 
 
 
³õѧÕß±ØÐëÕÆÎÕµÎ


Ïà¹ØÎĵµ£º

¹ØÓÚSQLʱ¼äÀàÐ͵ÄÄ£ºý²éѯ

½ñÌìÓÃtime Like '2008-06-01%'Óï¾äÀ´²éѯ¸ÃÌìµÄËùÓÐÊý¾Ý£¬±»ÌáʾÓï¾ä´íÎó¡£²éÁËһϲŷ¢ÏÖ¸ÃÄ£ºý²éѯֻÄÜÓÃÓÚStringÀàÐ͵Ä×ֶΡ£
×Ô¼ºÒ²²éÔÄÁËһЩ×ÊÁÏ¡£¹ØÓÚʱ¼äµÄÄ£ºý²éѯÓÐÒÔÏÂÈýÖÖ·½·¨£º
 
1.Convertת³ÉString,ÔÚÓÃLike²éѯ¡£
select * from table1   where c ......

SQL 2005ÖÐÎÄÂÒÂëÎÊÌâ

ʹÓÃSQL SERVER2005µÄʱºòÓöµ½ÁËÖÐÎÄ×Ö·ûΪÂÒÂëµÄÇé¿ö£¬¾­¹ýÑо¿·¢ÏÖ£¬ÉèÖÃSQLµÄÅÅÐò¹æÔò¿ÉÒÔ½â¾öÕâ¸öÎÊÌâ¡£
1¡¢µÇ¼·þÎñÆ÷´ò¿ªMicrosoft SQL Server Management Studio¡£
2¡¢ÔÚÒªÐ޸ĵÄÊý¾Ý¿âÉϵ¥»÷Êó±êÓÒ¼ü£¬²¢Ñ¡Ôñ“ÊôÐÔ”¡£
3¡¢ÔÚµ¯³öµÄÊý¾Ý¿âÊôÐÔ´°¿ÚÖеã»÷“Ñ¡ÔñÒ³”ÖеēѡÏ£ ......

SQL Server 2005/2008Êý¾Ý¿âÓʼþ

Æô¶¯Êý¾Ý¿âÓʼþ¹¦ÄÜ
 
sp_configure 'show advanced', 1;
GO
RECONFIGURE;
GO
sp_configure 'Database Mail XPs', 1;
GO
RECONFIGURE;
GO
 
 
 
 -- ÅäÖÃÊý¾Ý¿âÓʼþ
 -- Ìí¼ÓÓʼþÕË»§
execute msdb.dbo.sysmail_add_account_sp
    @account_name = 'ÓÊÏäÕ ......

ÓÃSQLÓï¾ä´´½¨±í&ÓÃSQLÓï¾ä´´½¨Êý¾Ý¿â

Êý¾Ý¿âÖеÄËùÓÐÊý¾Ý´æ´¢ÔÚ±íÖС£Êý¾Ý±í°üÀ¨ÐкÍÁС£Áоö¶¨Á˱íÖÐÊý¾ÝµÄÀàÐÍ¡£Ðаüº¬ÁËʵ¼ÊµÄÊý¾Ý¡£ 
ÀýÈ磬Êý¾Ý¿âpubsÖеıíauthorsÓоŸö×ֶΡ£ÆäÖеÄÒ»¸ö×Ö¶ÎÃûΪΪau_lname£¬Õâ¸ö×ֶα»ÓÃÀ´´æ´¢×÷ÕßµÄÃû×ÖÐÅÏ¢¡£Ã¿´ÎÏòÕâ¸ö±íÖÐÌí¼ÓÐÂ×÷Õßʱ£¬×÷ÕßÃû×־ͱ»Ìí¼Óµ½Õâ¸ö×ֶΣ¬²úÉúÒ»ÌõмǼ¡£ 
ͨ¹ý¶¨Òå×ֶ䪎 ......

sql server°²×°°æ±¾²é¿´


SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
productversion£º²úÆ·°æ±¾£¨ÀýÈ磬10.0.1600.22£©
productlevel£º²úÆ·¼¶±ð£¨ÀýÈ磬RTM£©
edition£º°æ±¾£¨ÀýÈ磬 Enterprise£¨ÆóÒµ°æ£©¡¢Developer Edition£¨¿ª·¢°æ£©£©
SELECT @@VERSION
΢Èí¾ßÌå˵Ã÷£º
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ