½â¾öSQL ServerתACCESS×Ô¶¯±àºÅÎÊÌâ
1.´ò¿ªSQL server enterprise mananger "ÆóÒµ¹ÜÀíÆ÷"
ÔÚÄãÒªµ¼³öµÄ SQLÊý¾Ý¿âÉÏÊó±êÓÒ¼ü²Ëµ¥£ºËùÓÐÈÎÎñ-¡·µ¼³öÊý¾Ý
2.»Ø³öÏÖÒ»¸öµ¼³öÏòµ¼´°¿Ú¡£
Ñ¡Ôñ±»µ¼³öµÄÊý¾ÝÔ´£¬ÎªÄã¸Õ²ÅËùÑ¡ÔñµÄÊý¾Ý¿â£¬Èç¹û·¢ÏÖ²»¶ÔÓ¦×ÔÐÐÐ޸ġ£
3.½øÈëµ¼³öµ½Ä¿±êÊý¾ÝÔ´µÄÑ¡Ôñ£¬ÕâÀïÎÒÃÇҪת³ÉACCESSµÄÊý¾Ý¿â¡£×¢ÒâÑ¡ÔñÊý¾ÝÔ´ÀàÐÍΪ“Microsoft Access¡£µã “ÎļþÃû(F)” ºóÃæµÄ°´Å¥Ñ¡ÔñÄ¿±ê.MDBÎļþ¡£
4.Ñ¡Ôñ“´ÓÊý¾Ý¿â¸´ÖƱíºÍÊÓͼ”¡£
5.ÎÒÃÇ×¢ÒâÕâÀïÑ¡±íµÄʱºòÓÒ±ßÓÐÒ»¸ö“ת»»”ÁС£SQLµ¼³öֻת»»Êý¾ÝÀàÐͲ¢²»¿¼ÂÇÆäËû½Å±¾ËùÒÔÎÒÃÇÓöµ½µÄ×Ô¶¯±àºÅÎÊÌâÒ²¾Í³öÔÚÕâÀï¡£ÓÐ×Ô¶¯±àºÅµÄÒ»¶¨ÒªµãÑ¡“ת»»”¡£
6.ÎÒÃǻؿ´µ½Ò»¸ö“ÁÐÓ³ÉäºÍת»»”¶Ô»°¿ò¡£ÓÐ×¢Òâµ½×ÔÔöµÄemployeeid int ×ÔÔöÕâÀï±ä³ÉÁËAccessÀïµÄlongÕâ¿Ï¶¨²»¶Ô£¬long²¢²»ÊÇ×Ô¶¯±àºÅ£¬Ö»ºÃÐ޸Ľ¨±í½Å±¾£¬Í¼Æ¬ÉÏÄǸöºìȦÀïµÄ°´Å¥“±à¼SQL”¡£
¿ªÒ»¸öС´°create talbe
ºìȦÖеĽű¾¾ÍÊÇemployeeid µÄ Access½¨±í½Å±¾£¬ÔÚ "NOT NULL" Ç°Ãæ¼ÓÉÏ "IDENTITY (1, 1)"¡£
7.Á¢¼´Ö´ÐС£
ÏÂͼ±íʾ½¨±í¸´ÖÆÒѳɹ¦
8.ÎÒÃÇ´ò¿ªMDBÎļþ¿´¿´ÊDz»ÊÇÈçÎÒÃÇËùÔ¸£¿
OKÍê³É£¬¹§Ï²Äã²Ù×÷³É¹¦
Ïà¹ØÎĵµ£º
.PivotµÄÓ÷¨Ìå»á:
Óï¾ä·¶Àý:
select PN,[2006/5/30] as [20060530],[2006/6/2] as [20060602]
from consumptiondata a
Pivot (sum(a.M_qty) FOR a.M_date in ([2006/5/30],[2006/6/2])) as PVT
order by PN
Table½á¹¹ Consumptiondata (PN,M_Date,M_qty)
order by PN¿ÉÒª¿É²»Òª,²¢²»ÖØ ......
ÉêÃ÷¡£ÎÄÕ½ö´ú±í¸öÈ˹۵㣬ÓëËùÔÚ¹«Ë¾ÎÞÈκÎÁªÏµ¡£
1. ¸ÅÊö
ÍøÒ³¹ÒÂíÕâ¸ö»°ÌâÏëÀ´´ó¼Ò²¢²»Ä°Éú¡£ÎªÊ²Ã´ÓÐÕâô¶àµÄÍøÒ³ÉÏ´æÔÚ×ÅľÂíÈ¥¹¥»÷ÆÕͨÓû§£¿²»¿É·ñÈÏ£¬Ï൱һ²¿·ÖÍøÒ³Ô±¾¾ÍÊǶñÒâµÄ£ºÍøÒ³µÄ×÷Õß¹ÊÒâÔÚÉÏÃæ·ÅÉÏľÂí£¬È»ºóͨ¹ý¸÷ÖÖÊÖ¶ÎÒýÓÕÓû§È¥ä¯ÀÀ¡£µ«ÊǾø´ó¶àÊý±»¹ÒÂíµÄÍøÒ³Ô±¾ÊÇÕý³ ......
Àý×Ó£ºÕÒ³öÿ¸ö¸èÊÖÏúÁ¿×î¸ßµÄ3Ê׸è
create table singer_info
(
id int primary key identity(1,1),
name varchar(20),
song varchar(20),
amount int
)
insert into singer_info values('jay','aaa',1000)
insert into singer_info values('jay','bbb',2000)
insert into singer_info values('jay','cc ......
ÊìϤSQL SERVER 2000µÄÊý¾Ý¿â¹ÜÀíÔ±¶¼ÖªµÀ£¬ÆäDTS¿ÉÒÔ½øÐÐÊý¾ÝµÄµ¼Èëµ¼³ö£¬Æäʵ£¬ÎÒÃÇÒ²¿ÉÒÔʹÓÃTransact-SQLÓï¾ä½øÐе¼Èëµ¼³ö²Ù×÷¡£ÔÚTransact-SQLÓï¾äÖУ¬ÎÒÃÇÖ÷ҪʹÓÃOpenDataSourceº¯Êý¡¢OPENROWSET º¯Êý£¬¹ØÓÚº¯ÊýµÄÏêϸ˵Ã÷£¬Çë²Î¿¼SQLÁª»ú°ïÖú¡£ÀûÓÃÏÂÊö·½·¨£¬¿ÉÒÔÊ®·ÖÈÝÒ×µØʵÏÖSQL SERVER¡¢ACCESS¡¢EXC ......
--´´½¨Ð´ÎļþµÄ´æ´¢¹ý³Ì
ALTER proc [dbo].[p_movefile]
@filename varchar(1000),--Òª²Ù×÷µÄÎı¾ÎļþÃû
@text varchar(8000), --ҪдÈëµÄÄÚÈÝ
@obj int
as
begin
declare @err int,
@src varchar(255),
&n ......