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

Çë½Ìsql¸ßÊÖ,¹ØÓÚms-sqlserverËø»úÖÆ

SQL code:

declare @cnt int
select @cnt=count(1) from TableTest
if(@cnt==0)
insert into TableTest values(1,'abc')



¶ÔÓÚÕâÑùµÄÒ»¶Îsql²¢·¢Ö´ÐÐʱ,Ó¦¸ÃÓпÉÄܲåÈëÖظ´¼Ç¼
²»ÖªµÀ´ó¼ÒÊÇÔõô·ÀÖ¹³öÏÖÖظ´Êý¾Ý,ÎÒÓÃÁË±í¼¶Ëø,¿ÉÊÇ»¹ÊdzöÏÖÁËÁ½ÌõͬÑù¼Ç¼
ÎÒÊÇÕâÑù´¦ÀíµÄ

SQL code:

declare @cnt int
begin tran
select @cnt=count(1) from TableTest with(TABLOCKX)
if(@cnt==0)
begin
insert into TableTest values(1,'abc')
commit tran
end


´òhappyflystone..³¬¼¶Ç¿ÈË..¸ú±«¶ûĬһÑùÇ¿..

Ö»ÖªµÀhappyflystone  ²»ÖªµÀ±«¶ûĬ

¼Ó¸öÔ¼Êø²»¾ÍÐÐÂð

with(TABLOCKX) »áÓÐxËø£¬Ó¦¸Ã²»»áÖظ´

ѧϰ

lzµÄд·¨ÖÁÉÙÓ¦¸ÃÓиöelse rollback tran


¶¥Ò»ÏÂ~

²»Çå³þ£¬¶¥ÏÂ×Ó

ѧϰ

ÒýÓÃ
lzµÄд·¨ÖÁÉÙÓ¦¸ÃÓиöelse rollback tran

up

ÒýÓÃ
ÒýÓà 6 Â¥ perfectaction µÄ»Ø¸´:
lzµÄд·¨ÖÁÉÙÓ¦¸ÃÓиöelse rollback tran

up


elseÎҵĴúÂëÀïÓÐ
É¢·Ö~


Ïà¹ØÎÊ´ð£º

asp.netÈçºÎÁ¬½ÓSQL SERVERÊý¾Ý¿â

ÎÒ°²×°SQL SERVER2008µÄʱºòÑ¡ÔñWINDOWSÉí·ÝÑéÖ¤Á¬½ÓµÄ£¬ÎÒ²»ÖªµÀÔõôдÁ¬½Ó¡£¡£¡£
»¹ÓÐÎÒÏë¸Ä³ÉSQL SERVERÉí·ÝÑéÖ¤Ôõô¸Ä£¿£¿
лл´ó¼ÒÁË£¡
XML code:

<configuration>
<appSettings>
& ......

SQLÓï¾äÕýÈ·µ«ÊÇRESULTSETÖÐûÓÐÖµ

StringBuffer str = new StringBuffer("select * from menu where parentid=1 and mid <>1 order by parentid");

List list = new ArrayList();
ResultSet rst = null;
DataBa ......

Çë½Ìoracleµ¼³öµ½sql server2005

û¸É¹ýÕâÊ£¬Ò²²»ÖªµÀoracleÊý¾Ý¿âɶÑù£¬Çë½Ì´óϺÃǾßÌå²½ÖèÊÇʲô£¿ÐèҪעÒâЩʲô£¿
ÊÇÕû¸ö¿âµÄÊý¾Ý»¹ÊÇ±íµ¥?

Õæ¸öÊý¾Ý¿â

Õû¸öÊý¾Ý¿â£¬ÁíÍâÎÒÊÇ´Óһ̨װÓÐoracleµÄµçÄÔµ¼Èëµ½Áíһ̨װÓÐsql serverµÄµçÄÔÖС ......

Ò»¸öSQLÓï¾äµÄÎÊÌâ¡£¸ßÊÖ°ï°ïæ

ÓÐÁ½¸ö±í¡£·Ö±ð¶¼ÓÐIDÖ÷¼ü¡£A±íµÄIDºÍB±íµÄIDÊǶÔÓ¦µÄ£¬¾ÍÊÇA±í¼¸¸öID£¬B±í¾Í¼¸¸öID¡£A±íµÄIDÊÇʲô,B±íµÄID¾ÍÊÇʲô¡£
¿ÉÊÇÏÖÔÚA±íµÄID±ÈB±íµÄ¶àÁË¡£
ÎÒÏÖÔÚÏëÒª°ÑB±íÖÐÉٵIJ¿·Ö¸ø²¹ÆëÁË¡£Õâ¸ö²åÈëÓ¦¸ÃÔõôд ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ