MSSQLµÄIndexÒ²ÒªÓÅ»¯¡£
ÔÚ´¦ÀíϵͳÓÅ»¯µÄʱºò£¬·¢ÏÖindexʹÓò»µ±µÄ»°£¬ÏµÍ³µÄÐÔÄܲ»Äܺܺ÷¢»Ó¡£
È磺½ñÌìµÄ·¢ÏÖµÄÒ»¸ösqlÓï¾ä£¬¾¹ý·ÖÎö£¬Ê¹ÓÃÁË2¸öindex¡£µ«ÊÇ2¸öindex·µ»ØµÄ¼Ç¼ÔÚ»¥ÏàÆ¥Åä¹ý³ÌÖкÄʱ×î¶à¡£ËùÒÔ£¬¼´Ê¹SQLÓï¾äʹÓÃindex£¬Ò²²»´ú±íÕâ¸öÓï¾äÔÚÐÔÄÜÉÏÊǺܺõġ£
Ïà¹ØÎĵµ£º
DECLARE @dt1 AS datetime, @dt2 AS datetime;
SELECT @dt1 = '2008-8-4 9:36:41', @dt2 = '2008-8-2 9:33:39';
DECLARE @Days AS int, @Hours AS int, @Minutes AS int, @Seconds AS int;
SET @Seconds = DATEDIFF( second, @dt2, @dt1);
SET @Days = @Seconds / (24 * 60 * 60)
SET @Seconds = @Seconds - @Da ......
¼ì²éËùʹÓõÄÓï¾äÊÇ·ñ±ê×¼
/*
±ê×¼SQLºÍT-SQLÖ®¼äÓкܶàÇø±ð——Ì«¶àÁË£¬ÕâÀï¾Í²»ËµÁË¡£»¹ÓУ¬Èç¹ûÄãÔÚSQL ServerÉϹ¤×÷£¬
ÄÇôʹÓÃÕâЩ˽ÓеÄÀ©Õ¹ÊÇÓкô¦µÄ¡£ÓÉÓÚÐí¶àSQL ServerµÄÌØÐԵı¾ÖÊ£¬Ä㲻ʹÓ÷DZê×¼µÄÃüÁîµÄ»°£¬
½«»áÓкܶàÇ¿´óµÄ¹¦ÄÜÎÞ·¨ÊµÏÖ¡ ......
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE data ......
SQL
insert into table_name(colum1,colum2)
select colum1,colum2
from opendatasource('sqloledb','data source=·þÎñÆ÷Ãû;user id=Óû§Ãû ;password=ÃÜÂë ').database_name.dbo.table_name
ÈçÖ´ÐгöÏÖÒÔÏ´íÎó”sql server ×èÖ¹Á˶Ô×é¼þ \'ad hoc distributed queries\' µÄ·ÃÎÊ&l ......