Çë½Ì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
¶¥Ò»ÏÂ~
²»Çå³þ£¬¶¥ÏÂ×Ó
ѧϰ
up
elseÎҵĴúÂëÀïÓÐ
É¢·Ö~
Ïà¹ØÎÊ´ð£º
ÎÒ°²×°SQL SERVER2008µÄʱºòÑ¡ÔñWINDOWSÉí·ÝÑéÖ¤Á¬½ÓµÄ£¬ÎÒ²»ÖªµÀÔõôдÁ¬½Ó¡£¡£¡£
»¹ÓÐÎÒÏë¸Ä³ÉSQL SERVERÉí·ÝÑéÖ¤Ôõô¸Ä£¿£¿
лл´ó¼ÒÁË£¡
XML code:
<configuration>
<appSettings>
& ......
@s='S1,S2,S12,S23';
½«@sÀïÃæµÄS1,S2Ìæ»»³É´¦Àí£¬Î´´¦Àí
À´ÕßÓзÖ.
REPLACE(@s,'S1,S2','´¦Àí,δ´¦Àí')
REPLACE ²»ºÃÓà ×Ô¼ºÊÔÏÂ
SQL code:
declare @s ......
û¸É¹ýÕâÊ£¬Ò²²»ÖªµÀoracleÊý¾Ý¿âɶÑù£¬Çë½Ì´óϺÃǾßÌå²½ÖèÊÇʲô£¿ÐèҪעÒâЩʲô£¿
ÊÇÕû¸ö¿âµÄÊý¾Ý»¹ÊÇ±íµ¥?
Õæ¸öÊý¾Ý¿â
Õû¸öÊý¾Ý¿â£¬ÁíÍâÎÒÊÇ´Óһ̨װÓÐoracleµÄµçÄÔµ¼Èëµ½Áíһ̨װÓÐsql serverµÄµçÄÔÖС ......
ÓÐÈý¸ö±íÒ»¸öÊDzɹºµ¥¸ñʽÈçÏÂ
Èë¿âµ¥±í£º
Èë¿âµ¥ºÅ ²úÆ· Öʼì±àºÅ Èë¿âÊýÁ¿
001 Æ·ÖÖ1&n ......
û¸É¹ýÕâÊ£¬Ò²²»ÖªµÀoracleÊý¾Ý¿âɶÑù£¬Çë½Ì´óϺÃǾßÌå²½ÖèÊÇʲô£¿ÐèҪעÒâЩʲô£¿
ORACLEÊý¾Ý¿âÀï±íµ¼ÈëSQL ServerÊý¾Ý¿â
1¡¢ÔÚÄ¿µÄSQL ServerÊý¾Ý¿â·þÎñÆ÷ÉÏ°²×°ORAC ......