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

¹ØÓÚSQL²éѯÓï¾äÀïÃæ½Øȡʱ¼äµÄº¯ÊýÈô¸É

ÓÐЩʱºòÎÒÃÇÐèÒª²éѯÊý¾Ý¿âÖеÄʱ¼ä×ֶΣ¬ÀýÈç2009-11-11 11:11:11:111 ÕâÑùµÄʱ¼ä¸ñʽ¡£
¶øÎÒÃÇÓÐЩʱºò²»ÓðÑÕû¸öµÄ×ֶβéѯ³öÀ´£¬ÐèÒª°ÑÇ°ÃæµÄÈÕÆÚ½ØÈ¡³öÀ´£¬»òÕ߰ѺóÃæµÄʱ¼ä½ØÈ¡³öÀ´¡£
Õâ¸öʱºò¾ÍÒªÓõ½SQLÀïÃæµÄʱ¼äº¯ÊýÁË£º
select convert(char(10),×Ö¶ÎÃû,108) from ±íÃû
ÉÏÊöÓï¾äÊǽ«ºóÃæµÄʱ¼ä²éѯ³öÀ´£¬¸ñʽΪ11:11:11¡£
convert()ºóÃæµÄ²ÎÊýÓÐÈý¸ö£¬µÚÒ»¸öÊdz¤¶È£¬µÚ¶þ¸öÊÇÒª½ØÈ¡µÄ×Ö¶ÎÃû£¬µÚÈý¸öÊÇʱ¼äÏÔʾµÄ¸ñʽ£¬µÚÈý¸ö²ÎÊý¿ÉÒÔ¸ù¾ÝÐèÒª¸Ä±ä¡£
µ±ÎÒÃÇÒª½ØÈ¡Ç°ÃæµÄ2009-11-11µÄʱºò°Ñ108¸Ä³É120¼´¿É¡£
ÒÀ´ÎÀàÍÆ£¬Ïêϸ½éÉܿɼûSQLµÄÁª»ú°ïÖúÎĵµ£¬ÊäÈëconvert¼ìË÷¼´¿É¡£


Ïà¹ØÎĵµ£º

MS SQL 2000 °²È«ÉèÖÃ

¡¡¡¡ÈÕÇ°SQL INJECTIONµÄ¹¥»÷²âÊÔÓúÑÝÓúÁÒ£¬ºÜ¶à´óÐ͵ÄÍøÕ¾ºÍÂÛ̳¶¼Ïà¼Ì±»×¢Èë¡£ÕâЩÍøÕ¾Ò»°ãʹÓõĶàΪSQL SERVERÊý¾Ý¿â£¬ÕýÒòΪÈç´Ë£¬ºÜ¶àÈË¿ªÊ¼»³ÒÉSQL SERVERµÄ°²È«ÐÔ¡£ÆäʵSQL SERVER 2000ÒѾ­Í¨¹ýÁËÃÀ¹úÕþ¸®µÄC2¼¶°²È«ÈÏÖ¤-ÕâÊǸÃÐÐÒµËùÄÜÓµÓеÄ×î¸ßÈÏÖ¤¼¶±ð£¬ËùÒÔʹÓÃSQL SERVER»¹ÊÇÏ൱µÄ°²È«µÄ¡£µ±È»ºÍORCAL¡¢DB2µ ......

SQL Server 2005 Analysis Services²¿Êðʱ±¨¸æ´íÎó

 Êý¾ÝÔ´......°üº¬ÎÞ·¨ÓÃÓÚ´¦Àí²Ù×÷µÄ ImpersonationMode¡£
½â¾ö·½·¨£º
·þÎñÆ÷Á¬½Ó¸ÄΪ“ʹÓ÷þÎñÕË»§”¡£
¾ßÌå²Ù×÷£º
ÔÚÊý¾ÝÔ´ÀïµÄÏîÄ¿Éϵã»÷ÓÒ¼ü->´ò¿ª->Êý¾ÝÔ´Éè¼ÆÆ÷ £¬ Ñ¡Ôñ“Ä£ÄâÐÅÏ¢”±êÇ©->Ñ¡Ôñ“ʹÓ÷þÎñÕË»§”£¬È·¶¨£¬Ö´Ðв¿Êð¡£ ......

̸SQL Server 2005ÖеÄT

 ¡¡1¡¢varchar(max)¡¢nvarchar(max)ºÍvarbinary(max)Êý¾ÝÀàÐÍ×î¶à¿ÉÒÔ±£´æ2GBµÄÊý¾Ý£¬¿ÉÒÔÈ¡´útext¡¢ntext»òimageÊý¾ÝÀàÐÍ¡£
CREATE TABLE myTable
(
id INT,
content VARCHAR(MAX)
)
¡¡¡¡2¡¢XMLÊý¾ÝÀàÐÍ
¡¡¡¡XMLÊý¾ÝÀàÐÍÔÊÐíÓû§ÔÚSQL ServerÊý¾Ý¿âÖб£´æXMLƬ¶Î»òÎĵµ¡£
¡¡¡¡´íÎó´¦Àí Error Handling
¡ ......

OracleÖУ¬ÓÃÒ»ÌõSqlʵÏÖÈÎÒâµÄÐÐתÁÐÆ´½Ó ¶àÐÐÆ´½Ó

 ±í½á¹¹ºÍÊý¾ÝÈçÏ£¨±íÃûTest£©£º
NO VALUE  NAME
1       a       ²âÊÔ1
1       b       ²âÊÔ2
1       c       ......

¶¯Ì¬SQL»ù±¾Óï·¨

1 :ÆÕͨSQLÓï¾ä¿ÉÒÔÓÃexecÖ´ÐÐ
Select * from tableName
exec('select * from tableName')
exec sp_executesql N'select * from tableName' -- Çë×¢Òâ×Ö·û´®Ç°Ò»¶¨Òª¼ÓN
2:×Ö¶ÎÃû£¬±íÃû£¬Êý¾Ý¿âÃûÖ®Àà×÷Ϊ±äÁ¿Ê±£¬±ØÐëÓö¯Ì¬SQL
declare @fname varchar(20)
set @fname = 'FiledName'
Select @fname from tab ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ