ÇÉÓÃSQL ServerÈÕÆÚÀàÐÍÊý¾Ý¶þ½øÖÆÊä³ö¼ÆËãʱ¼ä²î
1¡¢SQL ServerÈÕÆÚÊý¾Ý¿âÄÚ²¿±íʾ¼°²éѯÊä³ö£º
SQL ServerÄÚ²¿¶ÔDateTimeÀàÐ͵ıíʾÊÇÓÃ8¸ö×Ö½ÚÀ´±íʾ£¬ÆäÖÐÇ°4¸ö×Ö½Ú±íʾµÄÊýֵΪ×Ô1900Äê1ÔÂ1ÈÕÁãʱÒÔÀ´µÄÌìÊý£¬ºóËĸö×Ö½ÚÊÇÌìÊýÖ®ÍâµÄÓжàÉÙ¸ö1/300Ã룬ÕâҲ˵Ã÷SQL ServerÄÚ²¿±íʾʱ¼äµÄ¾«¶ÈΪ1/300Ã룬Լ3.3ºÁÃë¡£
³£¹æµÄSQL²éѯ£¬Õý³£ÈÕÆÚÊä³ö¸ñʽΪ:yyyy-MM-dd hh:mm:ss.SSS£¬ÕâÒ²ÊÇÖÐÎIJÙ×÷ϵͳµÄÈÕÆÚ¸ñʽ£¬¿ÉÒÔͨ¹ýÐ޸IJÙ×÷ϵͳÈÕÆÚ±í´ï¸ñʽÀ´Ó°ÏìSQL ServerȱʡµÄÈÕÆÚÊä³ö¸ñʽ¡£µ«ÊÇ£¬ÓÐЩʱºòȱʡµÄÈÕÆÚÊä³ö¸ñʽ²¢²»ÊÇÎÒÃÇÐèÒªµÄ£¬ÌرðÊÇ»ùÓÚʱ¼ä²îµÄÓ¦ÓÃÐèÇó¡£
2¡¢Ó¦ÓÃÐèÇó£º
»ùÓÚһϵÁÐʱ¼äµãµÄÊý¾Ý¼Ç¼·ÖÎö¡¢Í³¼ÆijÖÖ½á¹û¡£±ÈÈçGPS¶¨Î»É豸°´Ò»¶¨Ê±¼ä¼ä¸ô»Ø´«Î»ÖÃÊý¾Ý²¢¼Ç¼µ½Êý¾Ý¿âÖУ¬Êý¾Ý°üÀ¨¾Î³¶È¡¢Ê±¼ä¡¢Ëٶȵȣ¬ÏÖÔÚÐèÒª»ùÓÚÕâЩ»Ø´«Êý¾Ýͳ¼ÆÊÇ·ñÔÚijµØÓÐÍ£Áô£¬Í£Áôʱ¼ä¡¢¿ªÊ¼Ê±¼ä¡¢½áÊøʱ¼ä¡£Í£Áô±êÖ¾ÊÇËÙ¶ÈΪ0¡£ÏÔʾ£¬ÕâÐèÒª¸ù¾ÝÊý¾Ý¼Ç¼֮¼äµÄ²îÖµ×öͳ¼Æ¼ÆËã¡£
3¡¢ÊʺÏÐèÇóµÄÊä³ö¼°×ª»»¡¢´¦Àí£º
Èç¹û°´ÕÕȱʡµÄSQL ServerÈÕÆÚÊä³ö¸ñʽ£¬Êä³öÄÚÈÝ¿ÉÓ³ÉäΪ±à³ÌÓïÑÔÏà¹ØµÄÊý¾ÝÀàÐÍ£¬ÈçJava¿ÉÒÔÊÇString¡¢Date£¬×ªÎªÎªDateÓÐÒ»¶¨Í³¼ÆÊý¾ÝÁ¿µÄ»°£¬Õâ¸öת»»±¾Éí¾ÍÊǵÍЧºÍºÄʱµÄ£¬Êµ¼Ê¹ý³Ì¿ÉÄÜÊÇÏÈ´ÓSQL ServerÄÚ²¿±íʾת»»Îªyyyy-MM-dd hh:mm:ss.SSS×Ö·û´®£¬ÔÙ´ÓÕâ¸ö×Ö·û´®×ª»»ÎªDate£»×÷ΪStringʹÓÃÒ²ÐèҪת»»ÎªDateÖ®ºó²Å¿ÉÒÔ×öʱ¼ä²îÔËË㣬ͬÑùµÍЧ¡£
SQL ServerÄÚ²¿Êý¾Ý±íʾ¸ñʽÆäʵÒѾÊʺϱí´ïʱ¼ä²îÁË£¬ÊDz»ÊÇÄÜÖ±½ÓÀûÓá£SQL ServerÓÐcastº¯Êý£¬¿ÉÒÔ½«ÈÕÆÚÊä³öΪ¶þ½øÖÆÊý¾Ý¡£È磺
select longi, lati, speed, cast(gpsDate as binary(8)) as gpsDate from loc_history
ºóÐø´¦Àí´úÂëƬ¶ÎΪ£º
float lon = rs.getFloat("longi");
float lat = rs.getFloat("lati");
byte time[] = rs.getBytes("gpsDate");
»ñµÃ¾Î³¶È¡¢Ê±¼ä¶þ½øÖƱíʾ
int days = ((time[0] & 0x00ff) << 24) + ((time[1] & 0x00ff) << 16)
+ ((time[2] & 0x00ff) << 8) + (time[3] & 0x00ff);
int seconds = ((time[4] & 0x00ff) << 24) + ((time[5] & 0x00ff) << 16)
+ ((time[6] & 0x00f
Ïà¹ØÎĵµ£º
´Ó²»Í¬µÄ½Ç¶È£¬ÎÒÃÇ¿ÉÒÔ°ÑSQL ServerÊý¾Ýƽ̨»®·ÖΪ¶à¸ö×é¼þ¡£ÎÒÃÇÏÂÃæ°´ÕÕSQL Server Internal Teamͨ³£µÄ»®·ÖÔÔò£¬°ÑSQL ServerÊý¾Ýƽ̨»®·ÖΪÈçÏ£º
SSAS: SQL Server Analysis Service¡£Ö÷ÒªÓÃÀ´×ö·ÖÎöÓ㬱ÈÈçCube£¬¿ÉÒÔ´Ó²»Í¬µÄ½Ç¶ÈÉóÊÓÊý¾Ý¡£
SSIS: SQL Server Integration Servi ......
SQL SERVER2000´ò²¹¶¡ÎÊÌâ»ã×Ü ¡¾http://hi.baidu.com/yanhai/blog/item/cf67c2ce07a9f50992457e9d.html¡¿
SQL ServerµÄ²¹¶¡°æ±¾¼ì²é²»ÈçWindows ²¹¶¡°æ±¾¼ì²éÖ±½Ó£¬Ò»¸öϵͳ¹ÜÀíÔ±£¬Èç¹û²»Á˽âSQL Server°æ±¾¶ÔÓ¦µÄ²¹¶¡ºÅ£¬¿ÉÄÜÒ²»áÓöµ½Ò»µãÂé·³£¬Òò´ËÔÚÕâ˵Ã÷һϣ¬Í¨¹ýÕâÑùµÄ°ì·¨Åбð»úÆ÷ÊÇ°²È«µÄ°ì·¨£¬²»»á¶Ôϵͳ²úÉúÈ ......
Äܼà¿ØSQL ServerÊý¾Ý¿âÔËÐеÄÇé¿ö£¬¶Ô·þÎñÆ÷À´Ëµ¶¼ÊÇÒ»¼þ·Ç³£ÖØÒªµÄÊ£¬ÏÂÃ濪ʼ½éÉÜ¡£
Microsoft SQL Server 2005 ÌṩÁËһЩ¹¤¾ßÀ´¼à¿ØÊý¾Ý¿â¡£·½·¨Ö®Ò»ÊǶ¯Ì¬¹ÜÀíÊÓͼ¡£¶¯Ì¬¹ÜÀíÊÓͼ (DMV) ºÍ¶¯Ì¬¹ÜÀíº¯Êý (DMF) ·µ»ØµÄ·þÎñÆ÷״̬ÐÅÏ¢¿ÉÓÃÓÚ¼à¿Ø·þÎñÆ÷ʵÀýµÄÔËÐÐ×´¿ö¡¢Õï¶ÏÎÊÌâºÍÓÅ»¯ÐÔÄÜ¡£
³£¹æ·þÎñÆ÷¶¯Ì¬¹ÜÀí¶ÔÏó°ü ......
¾ßÌå½â¾ö²½Öè:
µÚÒ»²½:´ò¿ª SQL2005 ÓùÜÀíÔ±µÇ¼ÏÈ,È»ºóÔÚ·þÎñÃû´¦ÓÒ»÷Ñ¡ÊôÐÔ>°²È«ÐÔ>ÓұߵĵǼ·½Ê½Ñ¡Ïî¸ÄΪ Éí·ÝÑéÖ¤ È·¶¨!
µÚ¶þ²½:Ñ¡Ôñ°²È«ÐÔ(Õ¹¿ª)>µÇ¼Ãû>Ë«»÷sa>ÃÜÂë¸Ä³ÉÄãÐèÒªµÄÃÜÂë È·¶¨!
È»ºó¹ØµôSQL2005 »òÕß ¶Ï¿ªÁ¬½Ó
µÚÈý²½:µã¿ªÊ¼>³ÌÐò>Ñ¡ÔñSQL2005>ÅäÖù¤¾ß>´ò¿ª configurat ......