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

c# SQLÊý¾Ý¿âÔ¶³ÌÁ¬½Ó¼°ÅäÖ÷½·¨

Ò»£ºC# Á¬½ÓSQLÊý¾Ý¿â
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;
Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;
Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
1£ºIntegrated Security²ÎÊý
    µ±ÉèÖÃIntegrated SecurityΪ True µÄʱºò£¬Á¬½ÓÓï¾äÇ°ÃæµÄ UserID, PW ÊDz»Æð×÷Óõģ¬¼´²ÉÓÃwindowsÉí·ÝÑé֤ģʽ¡£
    Ö»ÓÐÉèÖÃΪ False »òÊ¡ÂÔ¸ÃÏîµÄʱºò£¬²Å°´ÕÕ UserID, PW À´Á¬½Ó¡£
    Integrated Security »¹¿ÉÒÔÉèÖÃΪ£ºsspi £¬Ï൱ÓÚ True£¬½¨ÒéÓÃÕâ¸ö´úÌæ True¡£
    Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
    Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=true;
    Data Source=myServerAddress;Initial Catalog=myDataBase;;User ID=myUsername;Password=myPasswordIntegrated Security=false;
2£º²ÎÊýTrusted_Connection
    Trusted_Connection=true£¬½«Ê¹Óõ±Ç°µÄ   Windows   ÕÊ»§Æ¾¾Ý½øÐÐÉí·ÝÑéÖ¤
    Trusted_Connection=false;½«²»²ÉÓÃÐÅÈÎÁ¬½Ó·½Ê½(Ò²¼´²»²ÉÓÃWindowsÑéÖ¤·½Ê½)£¬¶ø¸ÄÓÉSQL Server 2000ÑéÖ¤·½Ê½
    Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=false;
    Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;
3£ºInitial CatalogÊÇÄãÒªÁ¬½ÓµÄÊý¾Ý¿âµÄÃû×Ö
4£ºWINCEÁ¬½Ó
    Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;User ID=myDomain\myUsername;Password=myPassword;
¶þ£º¿ÉÒÔÀûÓÃSqlConnectionStringBuilder£¬ÕâÑù²»±ØÈ¥¼


Ïà¹ØÎĵµ£º

SQLʹÓü¼ÇÉ

Ò»¡¢¼Ó¿ìsqlµÄÖ´ÐÐËÙ¶È
¡¡¡¡1.select Óï¾äÖÐʹÓÃsort,»òjoin
¡¡¡¡Èç¹ûÄãÓÐÅÅÐòºÍÁ¬½Ó²Ù×÷£¬Äã¿ÉÒÔÏÈselectÊý¾Ýµ½Ò»¸öÁÙʱ±íÖУ¬È»ºóÔÙ¶ÔÁÙʱ±í½øÐд¦Àí¡£ÒòΪÁÙʱ±íÊǽ¨Á¢ÔÚÄÚ´æÖУ¬ËùÒԱȽ¨Á¢ÔÚ´ÅÅÌÉϱí²Ù×÷Òª¿ìµÄ¶à¡£
¡¡¡¡È磺
SELECT time_records.*, case_name¡¡
from time_records, OUTER cases¡¡
WHERE time_re ......

SQL ±êÁ¿Öµº¯ÊýµÄµ÷ÓÃ

µ÷Óà MS SQL ±êÁ¿Öµº¯Êý£¬Ó¦¸ÃÔÚº¯ÊýÇ°Ãæ¼ÓÉÏ "dbo."£¬·ñÔò»á±¨ “²»ÊÇ¿ÉÒÔʶ±ðµÄ ÄÚÖú¯ÊýÃû³Æ”´íÎó¡£ÀýÈç
    DECLARE @WhichDB TINYINT;
    SELECT @WhichDB = user_GetWhichDB(1);--¿´¿´ÊÇÄĸöÊý¾Ý¿âµÄ
=================================================
-- ......

ORACLE 10G PL/SQL PACKAGEѧϰ±Ê¼Ç


DBMS_CHANGE_NOTIFICATION
¶ÔÏó£¨±í£©Êý¾Ý¸üÐÂ֪ͨ
DBMS_APPLICATION_INFO
ÉèÖÃ/¶ÁÈ¡SESSION APPLICATIONÐÅÏ¢£¬²Ù×÷V$SESSION_LONGOPS
DBMS_ALERT
¸æ¾¯
DBMS_DATAPUMP
Êý¾ÝǨÒÆ
DBMS_DB_VERSION
Êý¾Ý¿â°æ±¾¶¨Òå
DBMS_DDL
Compiles¡¢wrapped¡¢Reorganizes ¶ÔÏó
DBMS_DEBUG
ORACLE DEPL/SQL debugger ¹¤¾ß
DB ......

Ò»¸ösql·ÖÒ³µÄ´æ´¢¹ý³Ì

 CREATE  procedure SqlPager_Ex
 @sqlstr varchar(8000), --²éѯ×Ö·û´®
  @currentpage int, --µÚNÒ³
  @pagesize int --ÿҳÐÐÊý, 
 as
  set nocount on
  declare @P1 int, --P1ÊÇÓαêµÄid
   @rowcount int
  exec sp_cursorope ......

sql serverÈÕÆÚʱ¼äº¯Êý

Sql ServerÖеÄÈÕÆÚÓëʱ¼äº¯Êý 
1.  µ±Ç°ÏµÍ³ÈÕÆÚ¡¢Ê±¼ä 
    select getdate()  
2. dateadd  ÔÚÏòÖ¸¶¨ÈÕÆÚ¼ÓÉÏÒ»¶Îʱ¼äµÄ»ù´¡ÉÏ£¬·µ»ØеĠdatetime Öµ
   ÀýÈ磺ÏòÈÕÆÚ¼ÓÉÏ2Ìì 
   sele ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ