VC ³ÌÐòÖÐÈçºÎÓÃADOÁ¬½ÓSQL Server 2005?
Ê×ÏÈ˵Ã÷Ò»µã£ºVC³ÌÐòÖÐÓÃADOÁ¬½ÓSQL Server 2005 ºÍÁ¬½Ó SQL Server 2000µÄÓï¾äºÍÁ¬½Ó×Ö·û´®ÊÇÍêÈ«Ò»ÑùµÄ£¬ÏÂÃæµÄ´úÂëÊÊÓÃÓÚÁ½¸öÊý¾Ý¿âµÄÁ¬½Ó¡£
ÁíÒ»µã˵Ã÷£ºÈç¹ûÄãÒÔÇ°°²×°¹ýSQL Server 2000£¬ºóÔÚûÓÐжÔصÄÇé¿öÏÂÓÖ°²×°ÁË2005£¬ÄÇôÄã֮ǰÔÚ2000ÖÐÉèÖõÄÓû§ÃûºÍÃÜÂëÔÚ2005Öлᱣ³Ö£¬¼´Ê¹Äã°²×°2005ʱδÉèÖÃÈκÎÓû§ÃûºÍÃÜÂë¡£
ÏÂÃæÊÇVC³ÌÐòÖÐÓÃADOÁ¬½ÓSQL ServerÊý¾Ý¿âµÄÒ»¸öÀý×Ó£º
£¨1£©´´½¨Ò»¸ö»ùÓÚ¶Ô»°¿òµÄ¹¤³Ì£¬¹¤³ÌÃûΪTest¡£
£¨2£©ÔÚStdAfx.hÖе¼ÈëADO¶¯Ì¬Á´½Ó¿â£¬´úÂëÈçÏ£º
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace\
rename("EOF","adoEOF")
£¨3£©ÔÚCTestApp::InitInstance()Öгõʼ»¯COM»·¾³£º
::CoInitialize(NULL);
×¢Ò⣬ÕâÌõÓï¾äÒ»¶¨Òª·ÅÔÚ“CTestDlg dlg;”ÕâÌõÓï¾äµÄÇ°Ã棬·ñÔòÔÚCTestDlgµÄº¯ÊýÖÐÁ¬½ÓÊý¾Ý¿â»áÒòÎÞ·¨´´½¨Á¬½ÓʵÀý¶øʧ
°Ü¡£
£¨4£©ÔÚ¶Ô»°¿òµÄÍ·ÎļþÖÐÉùÃ÷ADOÖÇÄÜÖ¸Õë¡£
_ConnectionPtr m_pConnection; //Á¬½Ó¶ÔÏóÖ¸Õë
_RecordsetPtr m_pRecordset; //¼Ç¼¼¯¶ÔÏóÖ¸Õë
£¨5£©ÔÚCTestDlg::OnInitDialog()ÖÐÁ¬½ÓÊý¾Ý¿â£º
try
{
m_pConnection.CreateInstance("ADODB.Connection"); //´´½¨Á¬½Ó¶ÔÏóʵÀý
_bstr_t strConnect="Provider=SQLOLEDB.1;Persist Security Info=False;Initial Catalog=Query;
Data Source=127.0.0.1"; //Á¬½Ó×Ö·û´®£¬ÕâÀïQueryÊÇÊý¾Ý¿âÃû£¬127.0.0.1´ú±í±¾µØÖ÷»ú
Ïà¹ØÎĵµ£º
1. ¸´ÖƱí½á¹¹
Sql´úÂë
1. select * into B from A where 1=0;
select * into B from A where 1=0;
2.¸´ÖƱí¼Ç¼ ¸´ÖÆijЩ×Ö¶Î
Sql´úÂë
1. insert into B(a, b, c) select d, e, f from A;
insert into B(a, b, c) select d, e, f from A;
¸´Ö ......
MDX º¯Êý²Î¿¼
SQL Server 2008 Áª»ú´ÔÊ飨2009 Äê 7 Ô£©
MDX º¯Êý²Î¿¼ (MDX)
Microsoft SQL Server Analysis Services ÔÊÐíÔÚ¶àά±í´ïʽ (MDX) Óï·¨ÖÐʹÓú¯Êý¡£º¯Êý¿ÉÒÔÔÚÈκÎÓÐЧµÄ MDX Óï¾äÖÐʹÓ㬲¢ÇÒ¾³£ÓÃÓÚ²éѯ¡¢×Ô¶¨Òå»ã×ܶ¨ÒåÒÔ¼°ÆäËû¼ÆËã¡£ ±¾½Ú½éÉÜ Analysis Services ¸½´øµÄ MDX º¯Êý¡£
¿ÉÒÔʹÓÃÏÂÃæÕâÐ ......
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[PE011_Page]
@TableName varchar(50), --±íÃû
@Fields varchar(5000) = '*', --×Ö¶ÎÃû(È«²¿×Ö¶ÎΪ*)
@OrderField varchar(5000), &n ......
1. ËÀËøÔÀí
¸ù¾Ý²Ù×÷ϵͳÖеĶ¨Ò壺ËÀËøÊÇÖ¸ÔÚÒ»×é½ø³ÌÖеĸ÷¸ö½ø³Ì¾ùÕ¼Óв»»áÊͷŵÄ×ÊÔ´£¬µ«Òò»¥ÏàÉêÇë±»ÆäËû½ø³ÌËùÕ¾Óò»»áÊͷŵÄ×ÊÔ´¶ø´¦ÓÚµÄÒ»ÖÖÓÀ¾ÃµÈ´ý״̬¡£
ËÀËøµÄËĸö±ØÒªÌõ¼þ£º
»¥³âÌõ¼þ(Mutual exclusion)£º×ÊÔ´²»Äܱ»¹²Ïí£¬Ö»ÄÜÓÉÒ»¸ö½ø³ÌʹÓá£
ÇëÇóÓë±£³ÖÌ ......
Ò»¡¢ÉîÈëdz³öÀí½âË÷Òý½á¹¹
ʵ¼ÊÉÏ£¬Äú¿ÉÒÔ°ÑË÷ÒýÀí½âΪһÖÖÌØÊâµÄĿ¼¡£Î¢ÈíµÄSQL SERVERÌṩÁËÁ½ÖÖË÷Òý£º¾Û¼¯Ë÷Òý£¨clustered index£¬Ò²³Æ¾ÛÀàË÷Òý¡¢´Ø¼¯Ë÷Òý£©ºÍ·Ç¾Û¼¯Ë÷Òý£¨nonclustered index£¬Ò²³Æ·Ç¾ÛÀàË÷Òý¡¢·Ç´Ø¼¯Ë÷Òý£©¡£ÏÂÃ棬ÎÒÃǾÙÀýÀ´ËµÃ÷һϾۼ¯Ë÷ÒýºÍ·Ç¾Û¼¯Ë÷ÒýµÄÇø±ð£º
Æäʵ£¬ÎÒÃǵĺºÓï×ÖµäµÄÕýÎı¾Éí¾ ......