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

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


Ïà¹ØÎĵµ£º

Çå³ýSQLServerÊý¾Ý¿âÈÕÖ¾(SqlServer2005)

ÔÚÖ÷Êý¾Ý¿âÎļþ½øÐдóÁ¿µÄɾ³ý(ÐÂÔö£¬Ð޸Ķ¼»áÓÐÈÕÖ¾)£¬ÈÕÖ¾ÎļþÓÐ1.5G¡£×òÌ컹ԭÊý¾Ý¿âʱ³õʼֵҲ²Å1MB¡£±ØÐëÇå³ýµô£¬²»È»Ì«Õ¼¿Õ¼äÁË¡£ÉÏÍøÕÒÁ˸öÇå³ýÈÕÖ¾µÄ·½·¨¡£Ë³Àû½«ÈÕÖ¾Îļþlog.ldf´Ó1.5G±äΪÁË1M¡£ ÎÒÖ´ÐÐÈçÏ£º
 1.Çå¿ÕÈÕÖ¾
 DUMP TRANSACTION ¿âÃû WITH NO_LOG
2.½Ø¶ÏÊÂÎñÈÕÖ¾£º
 BACKUP LOG ......

sqlserver´æ´¢¹ý³Ì¿½±´µ½¼Çʱ¾µÄÇé¿ö

×òÌìÉÏ´«³ÌÐòûÓгɹ¦£¬·¢ÏÖÒ»¸öÎÊÌâ
½«SQLServerµÄ´æ´¢¹ý³Ì¿½±´µ½¼Çʱ¾Ê±£¬Èç¹û¼Çʱ¾ÊÇ×Ô¶¯»Ø³µµÄ£¬ÐèҪעÒâһϲÎÊýÊÇ·ñ»Ø³µ¡£
¾ÙÀý£º
alter Proc [dbo].[aaa]
@tCardNos nvarchar(500), --Ïû·Ñ¿¨¿¨ºÅ@tCardPwds nvarchar(1000),--Ïû·Ñ¿¨¿¨ºÅ--¿¨ÃÜÂë@ProductId nvarchar(15), --²úÆ·±àºÅ
ËùÓеIJÎÊý¶¼Ô ......

SpringÅäÖõÄMS SQLSERVER 2008 JDBCÁ¬½Ó


  ²»µÃ²»ËµµÄÔÚ MS SQL SERVER Ï嵀 JDBC µ÷ÓÃ
 
½ñÌìÏÂÎ磬ÁÙʱ¾ö¶¨ÒªÔÙ MS SQL-SERVER  ÏÂÅäÖà Spring µÄÊý¾ÝÔ´ DataSource ¡£µ«ÅäÖÃÁË°ëÌì,»ñÈ¡Êý¾ÝÔ´ÈÔ²»³É¹¦£¬ÎÒûÓа취£¬ÕÒÔ­Òòߣ¬Ö»ÄÜд¸öÁÐ×Ó²âÊÔÏ¡£ÏȲ»¹ÜÈýÆ߶þʮһ£¬ÏÈÉÏÕýÈ·µÄÀý×ÓÔÙ˵¡£
¿´¿ÍÈç¹ûÏëÔËÐÐÏÂÃæµÄ´úÂ룬ÐèÒª×Ô¼ºÊÖ¹¤ ......

SQLServer ±í²éѯÖÐµÄ ºÏ²¢²éѯ ºÏ¼¯ ²î¼¯ ½»¼¯

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 ......

sqlserverÖÐÅúÁ¿Ð޸ĶÔÏóËùÓÐÕß

ÒÔ³¬¼¶¹ÜÀíÔ±µÇ¼ϵͳ£¬È»ºóÖ´ÐÐÒÔϽű¾¾Í¿ÉÒÔÅúÁ¿Ð޸ĶÔÏóËùÓÐÕß¡£
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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ