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

²é¿´sql server lock


 drop   table   #t  
  create   table   #t(req_spid   int,obj_name   sysname)   
  declare   @s   nvarchar(4000)   
  ,@rid   int,@dbname   sysname,@id   int,@objname   sysname   
  declare   tb   cursor   for     
  select   distinct   req_spid,dbname=db_name(rsc_dbid),rsc_objid   
  from   master..syslockinfo   where   rsc_type   in(4,5)   
  open   tb   
  fetch   next   from   tb   into   @rid,@dbname,@id   
  while   @@fetch_status=0   
  begin   
  set   @s='select   @objname=name   from   ['+@dbname+']..sysobjects   where   id=@id'   
  exec   sp_executesql   @s,N'@objname   sysname   out,@id   int',@objname   out,@id   
  insert   into   #t   values(@rid,@objname)   
  fetch   next   from   tb   into   @rid,@dbname,@id   
  end   
  close   tb   
  deallocate   tb   
  select   ½ø³Ìid=a.req_spid   
  ,Êý¾Ý¿â=db_name(rsc_dbid)   
  ,ÀàÐÍ=case   rsc_type   when   1   then   'NULL   ×ÊÔ´£¨Î´Ê¹Óã©'   
  when   2   then   N'Êý¾Ý¿â'   
  when   3   then   N'Îļþ'   
  when   4   then   N'Ë÷Òý'   
  when   5   then   N'±í'   
  when   6   then   N'Ò³'   
  when  


Ïà¹ØÎĵµ£º

SQL ServerÖÐÔ¼ÊøµÄ½éÉÜ

ÕªÒª
¶ÔÓÚSQL ServerÖеÄÔ¼Êø£¬Ïë±Ø´ó¼Ò²¢²»ÊǺÜÄ°Éú¡£µ«ÊÇÔ¼ÊøÖÐÕæÕýµÄÄÚº­ÊÇʲô£¬²¢²»ÊǺܶàÈ˶¼ºÜÇå³þµÄ¡£±¾ÎÄÒÔÏêϸµÄÎÄ×ÖÀ´½éÉÜÁËʲôÊÇÔ¼Êø£¬ÒÔ¼°ÈçºÎÔÚÊý¾Ý¿â±à³ÌÖÐÓ¦ÓúÍʹÓÃÕâЩԼÊø£¬À´´ïµ½¸üºÃµÄ±à³ÌЧ¹û¡££¨±¾ÎIJ¿·ÖÄÚÈݲο¼ÁËSQL ServerÁª»úÊֲᣩ
ÄÚÈÝ
 
Êý¾ÝÍêÕûÐÔ·ÖÀà
 
ʵÌåÍêÕûÐÔ
&nb ......

sqlÖг£Óö¯Ì¬µÄÐÐתÁÐ

//È¡³öÔ´Êý¾Ý
select groupname,totalnum,inputdate,groupid into #temp from
 (select count(*)as totalnum,p.groupid,g.groupname,convert(nvarchar(10),inputdate,120) as 'inputdate'
 from person p left join admin_group g on p.groupid = g.groupid and deleteflag = '0'
 where p.inactive=' ......

SQL Server2005 ±í·ÖÇøÈý²½Çú

Ç°ÑÔ
SQL Server 2005¿ªÊ¼Ö§³Ö±í·ÖÇø£¬ÕâÖÖ¼¼ÊõÔÊÐíËùÓеıí·ÖÇø¶¼±£´æÔÚͬһ̨·þÎñÆ÷ÉÏ¡£Ã¿Ò»¸ö±í·ÖÇø¶¼ºÍÔÚij¸öÎļþ×é(filegroup)Öеĵ¥¸öÎļþ¹ØÁª¡£Í¬ÑùµÄÒ»¸öÎļþ/Îļþ×é¿ÉÒÔÈÝÄɶà¸ö·ÖÇø±í¡£ÔÚÕâÖÖÉè¼Æ¼Ü¹¹Ï£¬Êý¾Ý¿âÒýÇæÄܹ»Åж¨²éѯ¹ý³ÌÖÐÓ¦¸Ã·ÃÎÊÄĸö·ÖÇø£¬¶ø²»ÓÃɨÃèÕû¸ö±í¡£Èç¹û²éѯÐèÒªµÄÊý¾ÝÐзÖÉ¢ÔÚ¶à¸ö·ÖÇøÖ ......

JDBCÁ¬½ÓSQL Server 2005µÄ·½·¨

Ò»¡¢ÏÂÔØ°²×°
1¡¢SQL Server 2005 Express Edition
ÏÂÔØ SQL Server 2005 Express Edition£¨ÏÂÔØÒ³Ã棩£º
http://msdn.microsoft.com/vstudio/express/sql/download/
°²×°ÍêÊý¾Ý¿âºóÉèÖÃICP/IPЭÒéÆô¶¯£¨ÕâÒ»²½²»ÄÜÉÙ£¬Ä¬ÈÏÊÇTCP/IP²»ÆôÓõģ©£¬¾ßÌåÈçÏ£º
£¨1£©´ò¿ªSQL Server Configuration Manager
£¨2£©×ªµ½SQL S ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ