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

select * into ºÍinsert into SQL SERVER

select * into destTbl from srcTbl
insert into destTbl(fld1, fld2) select fld1, 5 from srcTbl
ÒÔÉÏÁ½¾ä¶¼Êǽ« srcTbl µÄÊý¾Ý²åÈëµ½ destTbl£¬µ«Á½¾äÓÖÓÐÇø±ðµÄ£º
µÚÒ»¾ä£¨select into from£©ÒªÇóÄ¿±ê±í£¨destTbl£©²»´æÔÚ£¬ÒòΪÔÚ²åÈëʱ»á×Ô¶¯´´½¨¡£
µÚ¶þ¾ä£¨insert into select from£©ÒªÇóÄ¿±ê±í£¨destTbl£©´æÔÚ£¬ÓÉÓÚÄ¿±ê±íÒѾ­´æÔÚ£¬ËùÒÔÎÒÃdzýÁ˲åÈëÔ´±í£¨srcTbl£©µÄ×Ö¶ÎÍ⣬»¹¿ÉÒÔ²åÈë³£Á¿


Ïà¹ØÎĵµ£º

Óû§saµÇ¼ʧ°Ü,¸ÃÓû§Óë¿ÉÐÅsql serverÁ¬½ÓÎÞ¹ØÁª

½ñÌì²âÊÔwebÏîĿн¨ÁËÒ»¸öÊý¾Ý¿â£¬½á¹û±¨´í,ÒÔÇ°µÇ¼ֱ½ÓÑ¡Ôñ'WindowsÉí·ÝÑéÖ¤',²¢Ã»ÓÐʲôÎÊÌâ³öÏÖ!¿ÉÇ°¶Îʱ¼ä²ÉÓÃ'SQLSERVERÉí·ÝÑéÖ¤'È¥µÇ¼,ËæÖ®µÄÎÊÌâ¾ÍÀ´ÁË.ÎÞÂÛÓÃʲô·½·¨¾ÍÊÇÒ»¸ö½á¹û³ö´í! ³ö´íµÄÔ­ÒòÊÇ:'Óû§ 'sa' µÇ¼ʧ°Ü¡£¸ÃÓû§Óë¿ÉÐÅ SQL Server Á¬½ÓÎÞ¹ØÁª'.½ñÌìÉÏÍøÉϲéÁË°ëÌ컹ÊǸ㲻¶¨,×îºó¾­¹ýÍøÉϺÍÊéÉ ......

sql sever 2005 saĬÈÏÃÜÂëÊǶàÉÙ

Ê×ÏÈ£¬ÓÃwindows Éí·ÝÑéÖ¤ µÇ½ sql server 2005
ÒÀ´ÎÕ¹¿ª 
°²È«ÐÔ->µÇ¼Ãû
Ñ¡ÖÐ sa ÓÒ¼üµ¥»÷
Ñ¡ÖÐ ÊôÐÔ
µ¯³ö sa µÄÊôÐÔ¶Ô»°¿ò
¾ÍÔÚÃÜÂë´¦ ¸Ä ÃÜÂë ÐÐÁË
¸ÄÁËÃÜÂëºó Óà sa ºÍ Äã¸ÄµÄÃÜÂëµÇ½
Èç¹û»¹µÇ½²»ÉÏ
¾ÍÊÇÄãû´ò¿ª sql serverºÍ windowsÉí·ÝÑéÖ¤
ºÍûÊÚÓè sa µÇ½ȨÏÞ
½â¾ö°ì·¨ÈçÏÂ
£º£º£º£º ......

sql ·ÖÒ³Óï¾ä

1. select  top pageSize
* from table where id not in(select top((pageNo-1)*pageSize
) id from table order by id asc)
2. select * from table where  id<=pageSize*pageNo
and id>(pageNo-1)*pageSize
order by id asc
×¢£º
pagesizeÿҳÏÔʾµÄ¼Ç¼Êý
pageNoµ±Ç°µÚ¼¸Ò³
......

SQLº¯Êý:ÊÂÎñʵÀý ΰÉÙÌìµØ

ÊÂÎñ¾ÍÊǸºÔð°ÑһϵÁвÙ×÷¿´×öÒ»¸ö¶ÀÁ¢µÄÂß¼­µ¥Ôª£¬ÕâЩ²Ù×÷Ҫôͬʱ³É¹¦£¬ÒªÃ´Í¬Ê±Ê§°Ü¡£ÏÂÃæÊÇÒ»¸ö¾­µäµÄÀý×Ó£º
create procedure TransferMoeny
(
    @fromAccountNo varchar(50),-- ×ª³öÕ˺Å
    @ToAccountNo varchar(50),--תÈëÕ˺Å
 & ......

²Â²Â¿´£¬Hibernate»áÖ´Ðм¸¾äSQL(Ò»)

POEAAÖнéÉÜÁËORMÖÐ×îÖØÒªµÄģʽ֮һ£ºUnit Of Work¡£¿´ËƼòµ¥£¬ÊµÏÖÆðÀ´È´·Ç³£¸´ÔÓ¡£
HibernateÍêÃÀµÄʵÏÖÁËÕâ¸öģʽ¡£ÒÔÏÂÎÒÓÃһϵÁеÄÀý×ÓÀ´·ÖÎöHibernateµÄ´¦Àí»úÖÆ
ÏÂÃæÓÐÈý¸öÀý×Ó£¬²Â²Â¿´Hibernate»áÖ´Ðм¸¾äSQL(Ê¡ÂÔÊÂÎñ´¦Àí´úÂ룬ʵÌå¶ÔÏó½ÐUser£¬¼ÙÉèÖ÷¼üÊÇ×ÔÔöÐ͵Ä)
Àý1:
User user = new User();
user.setN ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ