SQLSERVERÍâÁ¬½Ó·û
±íA
tmpA:
id name
00 Ãû×ÖA
01 Ãû×ÖB
02 Ãû×ÖC
03 Ãû×ÖD
04 Ãû×ÖE
tmpB:
id class
02 °à¼¶A
06 °à¼¶B
ÔÚMicrosft SQL SERVER Management Studio ÖÐÖ´ÐÐÕâ¸öÓï¾ä select tmpA.id, tmpB.class from tmpA,tmpB where tmpB.id=*tmpA.id;¾Í»á±¨Õâ¸ö´í¡¾ÏûÏ¢ 4147£¬¼¶±ð 15£¬×´Ì¬ 1£¬µÚ 2 ÐÐ
´Ë²éѯʹÓõIJ»ÊÇ ANSI ÍⲿÁª½ÓÔËËã·û("*=" »ò "=*")¡£ÈôÒª²»½øÐÐÐ޸ļ´ÔËÐд˲éѯ£¬ÇëʹÓô洢¹ý³Ì sp_dbcmptlevel ½«µ±Ç°Êý¾Ý¿âµÄ¼æÈݼ¶±ðÉèÖÃΪ 80 »ò¸üµÍ¡£¼«Á¦½¨ÒéʹÓà ANSI ÍⲿÁª½ÓÔËËã·û(LEFT OUTER JOIN¡¢RIGHT OUTER JOIN)ÖØд´Ë²éѯ¡£ÔÚ½«À´µÄ SQL Server °æ±¾ÖУ¬¼´Ê¹ÔÚÏòºó¼æÈÝģʽÏ£¬Ò²²»Ö§³Ö·Ç ANSI Áª½ÓÔËËã·û¡£¡¿
¶ø´ÓjavaÀïµ÷ÓÃÖ´ÐУ¬¾Í¿ÉÒÔÕý³£Ö´ÐС£ '²»Ã÷°×Ϊʲô£¿'
<SQLSERVERÍâÁ¬½Ó·ûΪ'*',¶øORACLEΪ'+'>
select tmpA.id, tmpB.class from tmpA,tmpB where tmpB.id=*tmpA.id;
Óï¾äµÈ¼ÛÓÚ select tmpA.id, tmpB.class from tmpA LEFT JOIN tmpB on tmpB.id=tmpA.id
Êä³ö½á¹û£º
id class
00 NULL
01 NULL
02 °à¼¶A
03 NULL
04 NULL
//////////////
select tmpA.id, tmpB.class from tmpA RIGHT JOIN tmpB on tmpB.id=tmpA.id
Êä³ö½á¹û£º
id class
02 °à¼¶A
NULL °à¼¶B
//////////////
select tmpA.id, tmpB.class from tmpA FULL JOIN tmpB on tmpB.id=tmpA.id
Êä³ö½á¹û£º
id class
00 NULL
01 NULL
02 °à¼¶A
03 NULL
04 NULL
NULL °à¼¶B
Ïà¹ØÎĵµ£º
ÔÚÖ÷Êý¾Ý¿âÎļþ½øÐдóÁ¿µÄɾ³ý(ÐÂÔö£¬Ð޸Ķ¼»áÓÐÈÕÖ¾)£¬ÈÕÖ¾ÎļþÓÐ1.5G¡£×òÌ컹ÔÊý¾Ý¿âʱ³õʼֵҲ²Å1MB¡£±ØÐëÇå³ýµô£¬²»È»Ì«Õ¼¿Õ¼äÁË¡£ÉÏÍøÕÒÁ˸öÇå³ýÈÕÖ¾µÄ·½·¨¡£Ë³Àû½«ÈÕÖ¾Îļþlog.ldf´Ó1.5G±äΪÁË1M¡£ ÎÒÖ´ÐÐÈçÏ£º
1.Çå¿ÕÈÕÖ¾
DUMP TRANSACTION ¿âÃû WITH NO_LOG
2.½Ø¶ÏÊÂÎñÈÕÖ¾£º
BACKUP LOG ......
×òÌìÉÏ´«³ÌÐòûÓгɹ¦£¬·¢ÏÖÒ»¸öÎÊÌâ
½«SQLServerµÄ´æ´¢¹ý³Ì¿½±´µ½¼Çʱ¾Ê±£¬Èç¹û¼Çʱ¾ÊÇ×Ô¶¯»Ø³µµÄ£¬ÐèҪעÒâһϲÎÊýÊÇ·ñ»Ø³µ¡£
¾ÙÀý£º
alter Proc [dbo].[aaa]
@tCardNos nvarchar(500), --Ïû·Ñ¿¨¿¨ºÅ@tCardPwds nvarchar(1000),--Ïû·Ñ¿¨¿¨ºÅ--¿¨ÃÜÂë@ProductId nvarchar(15), --²úÆ·±àºÅ
ËùÓеIJÎÊý¶¼Ô ......
²»µÃ²»ËµµÄÔÚ MS SQL SERVER Ï嵀 JDBC µ÷ÓÃ
½ñÌìÏÂÎ磬ÁÙʱ¾ö¶¨ÒªÔÙ MS SQL-SERVER ÏÂÅäÖà Spring µÄÊý¾ÝÔ´ DataSource ¡£µ«ÅäÖÃÁË°ëÌì,»ñÈ¡Êý¾ÝÔ´ÈÔ²»³É¹¦£¬ÎÒûÓа취£¬ÕÒÔÒòߣ¬Ö»ÄÜд¸öÁÐ×Ó²âÊÔÏ¡£ÏȲ»¹ÜÈýÆ߶þʮһ£¬ÏÈÉÏÕýÈ·µÄÀý×ÓÔÙ˵¡£
¿´¿ÍÈç¹ûÏëÔËÐÐÏÂÃæµÄ´úÂ룬ÐèÒª×Ô¼ºÊÖ¹¤ ......
use tempdb
go
if (object_id ('t1' ) is not null ) drop table t1
if (object_id ('t2' ) is not null ) drop table t2
go
create table t1 (a int )
insert into t1 select 1 union select 2 union select 3
create table t2 (a int )
insert into t2 select 3 union select 4 union select 5
go
sele ......
ÒÔ³¬¼¶¹ÜÀíÔ±µÇ¼ϵͳ£¬È»ºóÖ´ÐÐÒÔϽű¾¾Í¿ÉÒÔÅúÁ¿Ð޸ĶÔÏóËùÓÐÕß¡£
sp_configure 'allow updates','1'
go
reconfigure with override
go
update sysobjects set uid=1 where uid<>1
go
sp_configure 'allow updates','0'
go
reconfigure with override ......