Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : sql

MyEclipse5.5ÏÂÁ¬½ÓSql Server 2008µÄ·½·¨

ÏÂÃæÊÇÖ¸µ¼Îĵµ¡£Çë¸ú×ÅÒ»²½²½µÄ×ö¡£¾ÍÄܳɹ¦Á¬½ÓÉÏsql server 2008
 
javaÖÐÁ¬½Ósql server 2008µÄ×¢ÒâÊÂÏ
2000£¬2005µÄÊý¾Ý¿âÇý¶¯ÀàµÄд·¨ÊÇ£º
com.microsoft.jdbc.sqlserver.SQLServerDriver
URLµÄд·¨ÊÇ£º¼ÙÉèÊý¾Ý¿âÊÇnews
jdbc:microsoft:sqlserver://localhost:1433;databaseName=news
 
µ«ÊÇ2008µÄÊý¾Ý¿âÇý¶¯ÀàµÄд·¨ÊÇ£º
com.microsoft.sqlserver.jdbc.SQLServerDriver
URLµÄд·¨ÊÇ£º¼ÙÉèÊý¾Ý¿âÊÇnews
jdbc:sqlserver://localhost:1433;databaseName=news
 
 
ÎÒÃÇʹÓõÄJDBCÇý¶¯ÊÇ sqljdbc4.jar
 
³ý´ËÖ®Í⣬ÎÒÃÇÒªÓÃjdk6.0²ÅÄÜÁ¬½Ósql server 2008£¬Èç¹ûÓÃ6.0ÒÔϵİ汾µÄ»°£¬»á±¨ ClassNotFountdException
 
ÔÚMyEclipse5.5ÀïÃæ£¬ÔõÑùÈù¤³ÌÔÚJDK6.0»·¾³ÏÂÔËÐУ¿
ÓÒ¼üij¸ö¹¤³Ì£¬Ñ¡ÔñPropertiesÑ¡Ï£¨Ò²¿ÉÒÔÑ¡Ôñij¸ö¹¤³Ì£¬È»ºó°´ÏÂAlt+Enter×éºÏ¼ü£©,½á¹ûÈçÏÂͼ1£º
ͼ1
 
È»ºóÑ¡ÖУº
µã»÷£º“Edit”£¬³öÏÖ½á¹ûÈçÏÂͼ2£º
ͼ2
ÔÚͼ2ÖУ¬Ñ¡ÖГAlternate JRE”È»ºóµã»÷“Installed JREs...”³öÏÖ½á¹ûÈçÏÂͼ3
ͼ3
ÔÚͼ3Öеã»÷MyEclispe5.5.1GA £¬È»ºóµã»÷“Ei ......

[ת]Éú³ÉÎÞ¼¶Ê÷(sqlº¯Êý)

--´¦ÀíʾÀý
--ʾÀýÊý¾Ý
create table tb(ID int,Name varchar(10),ParentID int)
insert tb select 1,'AAAA'    ,0
union all select 2,'BBBB'    ,0
union all select 3,'CCCC'    ,0
union all select 4,'AAAA-1'  ,1
union all select 5,'AAAA-2'  ,1
union all select 6,'BBBB-1'  ,2
union all select 7,'CCCC-1'  ,3
union all select 8,'CCCC-2'  ,3
union all select 9,'AAAA-1-1',4
go
--´´½¨´¦ÀíµÄº¯Êý
create function f_id()
returns @re table(id int,level int,sid varchar(8000))
as
begin
    declare @l int
    set @l=0
    insert @re select id,@l,right(10000+id,4)
    from tb where ParentID=0
    while @@rowcount>0
    begin
        set @l=@l+1
        insert @re select a.id,@l,b.sid+','+right(10000+a.id,4)
        from ......

Ôõô°Ñ sqlÓï¾ä²éѯµÄÖµ¸³¸ø±äÁ¿

string str = System.Configuration.ConfigurationManager.AppSettings["strconn"];
string sqlpwd = "select password from bg_user where username='" + username + "'";
MySqlConnection conn = new MySqlConnection(str);
MySqlCommand cmd=new MySqlCommand(sqlpwd,conn);
MySqlDataAdapter adr = new MySqlDataAdapter(cmd);
DataSet ds=new DataSet();
adr.Fill(ds);
string pwd = ds.Tables[0].Rows[0]["password"].ToString(); ......

SQL XML DELETE

--A. ´Ó´æ´¢ÔÚ·ÇÀàÐÍ»¯µÄ xml ±äÁ¿ÖеÄÎĵµÖÐɾ³ý½Úµã
DECLARE @myDoc xml
SET @myDoc = '<?Instructions for=TheWC.exe ?>
<Root>
 <!-- instructions for the 1st work center -->
<Location LocationID="10" LaborHours="1.1" MachineHours=".2" >
 Some text 1
 <step>Manufacturing step 1 at this work center</step>
 <step>Manufacturing step 2 at this work center</step>
</Location>
</Root>'
SELECT @myDoc
-- delete an attribute
SET @myDoc.modify('
  delete /Root/Location/@MachineHours
')
SELECT @myDoc
-- delete an element
SET @myDoc.modify('
  delete /Root/Location/step[2]
')
SELECT @myDoc
-- delete text node (in <Location>
SET @myDoc.modify('
  delete /Root/Location/text()
')
SELECT @myDoc
-- delete all processing instructions
SET @myDoc.modify('
  delete //processing-instruction()
')
SELECT @myDoc
--B. ´Ó´æ´¢ÔÚ·ÇÀàÐÍ»¯µÄ xml ÁÐÖеÄÎĵµÖÐɾ³ý½Úµã
delete XML DML Óï¾ ......

SQL XML DELETE

--A. ´Ó´æ´¢ÔÚ·ÇÀàÐÍ»¯µÄ xml ±äÁ¿ÖеÄÎĵµÖÐɾ³ý½Úµã
DECLARE @myDoc xml
SET @myDoc = '<?Instructions for=TheWC.exe ?>
<Root>
 <!-- instructions for the 1st work center -->
<Location LocationID="10" LaborHours="1.1" MachineHours=".2" >
 Some text 1
 <step>Manufacturing step 1 at this work center</step>
 <step>Manufacturing step 2 at this work center</step>
</Location>
</Root>'
SELECT @myDoc
-- delete an attribute
SET @myDoc.modify('
  delete /Root/Location/@MachineHours
')
SELECT @myDoc
-- delete an element
SET @myDoc.modify('
  delete /Root/Location/step[2]
')
SELECT @myDoc
-- delete text node (in <Location>
SET @myDoc.modify('
  delete /Root/Location/text()
')
SELECT @myDoc
-- delete all processing instructions
SET @myDoc.modify('
  delete //processing-instruction()
')
SELECT @myDoc
--B. ´Ó´æ´¢ÔÚ·ÇÀàÐÍ»¯µÄ xml ÁÐÖеÄÎĵµÖÐɾ³ý½Úµã
delete XML DML Óï¾ ......

SQL server°²×°Ê±±¨¹ÒÆð´íÎó

SQL server°²×°Ê±±¨¹ÒÆð´íÎó
SQL server°²×°Ê±Ê±£º¡°ÒÔǰµÄij¸ö³ÌÐò°²×°ÒÑÔÚ°²×°¼ÆËã»úÉÏ´´½¨¹ÒÆðµÄÎļþ²Ù×÷¡£ÔËÐа²×°³ÌÐò֮ǰ±ØÐëÖØÐÂÆô¶¯¼ÆËã»ú¡±´íÎó¡£ ´ò¿ª×¢²á±í±à¼­Æ÷£¨¿ªÊ¼->ÔËÐÐ->regedit£©£¬ÔÚHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session ManagerÖÐÕÒµ½PendingFileRenameOperationsÏîÄ¿£¬²¢É¾ ... ......

oracle³£Óþ­µäSQL²éѯ£¨×ªÔØ£©

³£ÓÃSQL²éѯ£º
1¡¢²é¿´±í¿Õ¼äµÄÃû³Æ¼°´óС
select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size
from dba_tablespaces t, dba_data_files d
where t.tablespace_name = d.tablespace_name
group by t.tablespace_name;
2¡¢²é¿´±í¿Õ¼äÎïÀíÎļþµÄÃû³Æ¼°´óС
select tablespace_name, file_id, file_name,
round(bytes/(1024*1024),0) total_space
from dba_data_files
order by tablespace_name;
3¡¢²é¿´»Ø¹ö¶ÎÃû³Æ¼°´óС
select segment_name, tablespace_name, r.status,
(initial_extent/1024) InitialExtent,(next_extent/1024) NextExtent,
max_extents, v.curext CurExtent
from dba_rollback_segs r, v$rollstat v
Where r.segment_id = v.usn(+)
order by segment_name;
4¡¢²é¿´¿ØÖÆÎļþ
select name from v$controlfile;
5¡¢²é¿´ÈÕÖ¾Îļþ
select member from v$logfile;
6¡¢²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_name;
SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
(B.BYTES*1 ......

oracle³£Óþ­µäSQL²éѯ£¨×ªÔØ£©

³£ÓÃSQL²éѯ£º
1¡¢²é¿´±í¿Õ¼äµÄÃû³Æ¼°´óС
select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size
from dba_tablespaces t, dba_data_files d
where t.tablespace_name = d.tablespace_name
group by t.tablespace_name;
2¡¢²é¿´±í¿Õ¼äÎïÀíÎļþµÄÃû³Æ¼°´óС
select tablespace_name, file_id, file_name,
round(bytes/(1024*1024),0) total_space
from dba_data_files
order by tablespace_name;
3¡¢²é¿´»Ø¹ö¶ÎÃû³Æ¼°´óС
select segment_name, tablespace_name, r.status,
(initial_extent/1024) InitialExtent,(next_extent/1024) NextExtent,
max_extents, v.curext CurExtent
from dba_rollback_segs r, v$rollstat v
Where r.segment_id = v.usn(+)
order by segment_name;
4¡¢²é¿´¿ØÖÆÎļþ
select name from v$controlfile;
5¡¢²é¿´ÈÕÖ¾Îļþ
select member from v$logfile;
6¡¢²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_name;
SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
(B.BYTES*1 ......
×ܼǼÊý:4346; ×ÜÒ³Êý:725; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [433] [434] [435] [436] 437 [438] [439] [440] [441] [442]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ