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

¸´ÖÆmssqlÐеÄÎÊÌâ - Web ¿ª·¢ / ASP

ÈçÌâ
ÎÒʹÓÃ

VBScript code:
conn.execute("SET IDENTITY_INSERT [abc] On" & vbcrlf & "insert into [abc] (id,name,qq,msn) select (select top 1 id from [abc] order by id desc)+1,name,qq,msn) from [abc] where id="&sid&" & vbcrlf & "SET IDENTITY_Insert [abc] OFF")


ÕâÑù¿ÉÒÔ¸´ÖÆеÄÒ»ÐУ¬µ«ÊÇÈç¹ûÓкܶàÓû§Í¬Ê±Ê¹Óã¬Èç¹û²¢·¢µÄ»°£¬ÕâÀïÃæµÄselect top 1¿Ï¶¨¾Í²»¶ÔÁË£¿

Ó¦¸ÃÔõô½â¾öÄØ£¿ÓÐÁíÍâ±È½Ï·½±ãµÄ¸´ÖÆmssqlÐеķ½·¨Âð£¿

ÏÈselect³öÀ´Ò»¸ö¼Ç¼¼¯£¬ÔÙconn.execute insert intoдÈëÊý¾Ý¿â£¿


ÄãµÄÒâ˼ÊÇ£¬ÎÒÓÃIDENTITY_INSERT OnÕâÑùµÄÓï¾äû¹ØϵÂð£¿

ÒýÓÃ
Ó¦¸Ã²»»á£¬ÓÐÊÂÎñºÍËø
Óï¾äÌ«¶àд´æ´¢¹ý³Ì£¬ÕâÑù³ÌÐòά»¤·½±ã



Ïà¹ØÎÊ´ð£º

AccessºÍMSSQLµÄÒÉÎÊ - .NET¼¼Êõ / C#

ÀÏ´óÈÃ×öÒ»¸öÈí¼þ£¬ÒªÓÃAccess£¬ËµÄܵ¥¶ÀÔËÐÐ...
ÎÒ²»Ì«¶®£¬ÄѵÀAccess²»Óð²×°¾ÍÄÜÔËÐУ¿...
ÓÃC#·ÃÎÊACCESSʱ¿ÉÒÔ²»Óð²×°£¬Ö»ÒªÓÐMDAC¾ÍÐС£

ÐèÒªÄǸö×é¼þ,MDAC,Ò»°ã¼ÆËã»ú¶¼°²×°Á˵Ä.

Acess,ÊÇOfficeÍêÈ ......

ÇóÒ»¸ömssqlµÄsqlÓï¾ä - MS-SQL Server / »ù´¡Àà

ÅжϱíÖÐÊÇ·ñÓдóÓÚ10ÌõÒÔÉϵÄÊý¾Ý£¬
Èç¹û´æÔÚÔò°´×îºÃ¼ÈëµÄʱ¼ä£¬É¾³ýµô¶àÓàµÄÊý¾Ý¡£¡£
±£³ÖÊý¾Ý±íÖÐÖ»ÓÐ10Ìõ×îеÄÊý¾Ý¡£¡£
лл¡£
select ID,count(1) from TB group by ID having count(1)>10


SQL ......

¡¾SOS¡¿ MSSQLÊý¾Ý¿âÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ

select id,name,type from A union all 
select id,name,type from B union all 
select id,name,type from C union all where ???
----------------------------------------------------
  ......

MSSQL ÈçºÎÍêÕûµÄ¸´ÖÆÒ»±í - MS-SQL Server / »ù´¡Àà

ÈçÌâ,Ö»Òª±í½á¹¹.²»ÐèÒªÊý¾ÝµÄ.±í½á¹¹¸´Öƺܺø´ÖÆ.µ«ÊǸú±íÓйصĴ¥·¢Æ÷,Ë÷ÒýµÈ,»¹ÓÐͳ¼ÆÐÅÏ¢Õâ¸öÊý¾ÝÄܹ»Ò»Æð¸´ÖÆ×ßÂð.¾ÍÊÇÁ½ÕűíÊÇһģһÑùµÄ.
select * into b from a

ÒýÓÃ
select * into b from a
ûÓÃ,Õ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ