??xml version="1.0" encoding="utf-8" standalone="yes"?>99国产一区二区三精品乱码,亚洲一区二区四区蜜桃,91精品国产色综合久久 http://www.aygfsteel.com/kiant/category/39361.html有才而性缓定属大才Q有气和斯为大智。h偏狭我受之以宽容Qh险仄我持之以坦荡。缓事宜急干Q敏则有功;急事宜缓办,忙则多措? --李叔?/description>zh-cnWed, 05 May 2010 14:34:24 GMTWed, 05 May 2010 14:34:24 GMT60@@IDENTITYQSCOPE_IDENTITY和IDENT_CURRENThttp://www.aygfsteel.com/kiant/articles/318910.html黄小?/dc:creator>黄小?/author>Tue, 20 Apr 2010 14:42:00 GMThttp://www.aygfsteel.com/kiant/articles/318910.htmlhttp://www.aygfsteel.com/kiant/comments/318910.htmlhttp://www.aygfsteel.com/kiant/articles/318910.html#Feedback0http://www.aygfsteel.com/kiant/comments/commentRss/318910.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/318910.html 内容引用自:
@@IDENTITYQSCOPE_IDENTITY和IDENT_CURRENT的L?
http://www.cnblogs.com/xlong1900/archive/2008/09/01/1281001.html



@@IDENTITYQSCOPE_IDENTITY和IDENT_CURRENT的L?/strong>

SQLServer中@@IDENTITYQSCOPE_IDENTITY和IDENT_CURRENT的作?br /> 相同点:
它们都返回插入到IDENTITY列中的?/span>?br />
不同点:

  A.  @@IDENTITY不受作用域(存储q程、触发器、函数或批处理)的限制。返回最后一个插入的IDENTITY?/span>。如果在E序中不同的作用域插入的表不同,那么q回最后一个表插入的IDENTITY倹{例如:作用域AQ存储过E)在表T1上插入IDENTITY列,而T1上的触发器会在T2上插入IDENTITY列。则用@@IDENTITYq回T2上插入的IDENTITY倹{?br />
  B. SCOPE_IDENTITY()受作用域的限Ӟ只返回当前作用域中的最后一个IDENTITY?/span>。上例中Q如果在存储q程中用SCOPE_IDENTITY()Q则q回T1的IDENTITY倹{?br />
  C. IDENT_CURRENT()不受作用域的限制Q调用它时必L供表C名的字符型参敎ͼ你可以得C惌的Q何表的最后一个IDENTITY|即你的代码里没有插入动?/span>。例如:IDENT_CURRENT('T1')Q?br />

l验Q?/strong>
  Ҏ(gu)不同的用场合,选择不同的函数。如果在写存储过E时Q向表中新增了一条数据,需要返回该IDENTITY|则?nbsp;SCOPE_IDENTITY()Q因为它和当前会话相兌Q不会返回一个你不需要的倹{如果你仅仅惛_到某个IDENTITY列的最后一个|则?nbsp;IDENT_CURRENT()最方便?br />


]]>
SQL Server、MySQL?Oracle的行合ƈhttp://www.aygfsteel.com/kiant/articles/317866.html黄小?/dc:creator>黄小?/author>Fri, 09 Apr 2010 08:24:00 GMThttp://www.aygfsteel.com/kiant/articles/317866.htmlhttp://www.aygfsteel.com/kiant/comments/317866.htmlhttp://www.aygfsteel.com/kiant/articles/317866.html#Feedback0http://www.aygfsteel.com/kiant/comments/commentRss/317866.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/317866.html 内容引自Q?br /> 多行一列数据合q成一行一列数?br /> http://topic.csdn.net/u/20090714/17/5FE6A0F7-CE78-4936-BE31-21D462236059.html

在MySQL和Oracle中实现行合ƈ
http://www.aygfsteel.com/rain1102/archive/2009/06/24/283867.html


SQL Server
--SQL2005中的Ҏ(gu)2 
create table tb(id int, value varchar(10)) 
insert into tb values(1'aa'
insert into tb values(1'bb'
insert into tb values(2'aaa'
insert into tb values(2'bbb'
insert into tb values(2'ccc'
go 

select id, [values]=stuff((select ','+[value] from tb t where id=tb.id 
for xml path('')), 11''
from tb 
group by id 

/* 
id          values 
----------- -------------------- 
1          aa,bb 
2          aaa,bbb,ccc 

(2 row(s) affected) 

*/ 

drop table tb 


MySQL
select name , group_concat(email order by email separator ", ") as email from student group by name


Oracle
如果以上效果惛_Oracle中显C? 则比较复杂点? 因ؓOracle中没有行合ƈ函数, 则需要用sys_connect_by_path()来实? 代码如下:
select name, ltrim(sys_connect_by_path(email,','),',') email from(
select name,email,
row_number() 
over(partition by name order by email) rn,
count(*over(partition by name) cnt
from student 
where level = cnt
start 
with rn = 1
connect 
by prior name = name and prior rn + 1 = rn 


]]>
SQL 中存?varbinary型数?/title><link>http://www.aygfsteel.com/kiant/articles/295086.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Tue, 15 Sep 2009 00:49:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/295086.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/295086.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/295086.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/295086.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/295086.html</trackback:ping><description><![CDATA[<br /> 转蝲自帮助文?<br /> ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.zh-CHS/s10de_6tsql/html/f47eda43-33aa-454d-840a-bb15a031ca17.htm<br /> <br /> <h3 class="subHeading" xmlns="">使用带有 BULK 选项?OPENROWSET</h3> <div id="wmqeeuq" class="subSection" xmlns=""><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"> <p xmlns="">以下 Transact-SQL 增强功能支持 OPENROWSET(BULK...)函数Q?/p> <ul xmlns=""> <li>?SELECT 一起用的 FROM 子句可以调用 OPENROWSET(BULK...)而非表名Q同时可以实现完整的 SELECT 功能?br /> <br /> 带有 BULK 选项?OPENROWSET ?FROM 子句中需要有一个相兛_Uͼ也称围变量或别名。可以指定列别名。如果未指定列别名列表,则格式化文g必须h列名。指定列别名会覆盖格式化文g中的列名Q例如:<br /> <br /> <code>FROM OPENROWSET(BULK...) AS table_alias</code> <br /> <br /> <code>FROM OPENROWSET(BULK...) AS table_alias(column_alias,...n)</code> <br /> <br /> <li>SELECT...FROM OPENROWSET(BULK...)语句直接查询文件中的数据,无需数据导入表中。SELECT…FROM OPENROWSET(BULK...)语句q可以通过使用格式化文件指定列名和数据cdQ从而列出大定w列别名?br /> <br /> <li>通过?OPENROWSET(BULK...)用作 INSERT ?MERGE 语句中的源表Q将数据文g中的数据大容量导?SQL Server 表中。有兌l信息,请参?MSHelp:link tabindex="0" keywords="18a64236-0285-46ea-8929-6ee9bcc020b9" filterstring='(("ProductVers"="kbsqlserv100") OR ("DocSet"="NETFramework"))'>使用 BULK INSERT ?OPENROWSET(BULK...) 导入大容量数?/MSHelp:link>?br /> <br /> <li>OPENROWSET BULK 选项?INSERT 语句一起用时QBULK 子句支持表提C。BULK 子句除了接受 TABLOCK {常规表提示之外Q还可以接受下列专用表提C:IGNORE_CONSTRAINTSQ仅忽略 CHECK ?FOREIGN KEY U束Q、IGNORE_TRIGGERS、KEEPDEFAULTS ?KEEPIDENTITY。有兌l信息,请参?MSHelp:link tabindex="0" keywords="8bf1316f-c0ef-49d0-90a7-3946bc8e7a89" filterstring='(("ProductVers"="kbsqlserv100") OR ("DocSet"="NETFramework"))'>表提C?(Transact-SQL)</MSHelp:link>?br /> <br /> </li> </ul> <p xmlns="">有关如何使用 INSERT...SELECT * FROM OPENROWSET(BULK...) 语句的信息,请参?MSHelp:link tabindex="0" keywords="19049021-c048-44a2-b38d-186d9f9e4a65" filterstring='(("ProductVers"="kbsqlserv100") OR ("DocSet"="NETFramework"))'>导入和导出大定w数据</MSHelp:link>。有关何时在事务日志中记录由大容量导入执行的行插入操作的信息Q请参阅<MSHelp:link tabindex="0" keywords="bd1dac6b-6ef8-4735-ad4e-67bb42dc4f66" filterstring='(("ProductVers"="kbsqlserv100") OR ("DocSet"="NETFramework"))'>在大定w导入中按最方式记录日志的前提条g</MSHelp:link>?/p> <div id="wmqeeuq" class="alert" xmlns=""> <table cellspacing="0" cellpadding="0" width="100%"> <tbody> <tr> <th align="left"><img class="note" src="ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.zh-CHS/s10de_6tsql/local/note.gif" alt="" /></img>注意Q?/th> </tr> <tr> <td>使用 OPENROWSET Ӟ请务必了?SQL Server 是如何处理模拟的。有兛_全注意事的信息Q请参阅<MSHelp:link style="color: #0000ff" tabindex="0" xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" keywords="18a64236-0285-46ea-8929-6ee9bcc020b9" filterstring='(("ProductVers"="kbsqlserv100") OR ("DocSet"="NETFramework"))'>使用 BULK INSERT ?OPENROWSET(BULK...) 导入大容量数?/MSHelp:link>?/td> </tr> </tbody> </table> </div> <br /> </div> <br /> <br /> 一些奇怪的CZQ?br /> <br /> <span style="color: #0000ff">declare @obj varbinary(max)<br /> set @obj=(select * FROM OPENROWSET (Bulk 'c:\123.jpg', SINGLE_BLOB) as obj )<br /> select @obj<br /> <br /> <br /> Insert Infomation_Info(Title,Content,RecordUserID,Abstract,<br />    Source,SourceWebsite,ApproveID,Disable,Remark,Status,<br />    Thumbnail)<br />   Select @Title,@Content,@RecordUserID,@Abstract,<br />    @Source,@SourceWebsite,@ApproveID,@Disable,@Remark,@Status,<br />    * FROM OPENROWSET (Bulk 'c:\123.jpg', SINGLE_BLOB) AS Thumbnail</span><br /> <br /> <img src ="http://www.aygfsteel.com/kiant/aggbug/295086.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2009-09-15 08:49 <a href="http://www.aygfsteel.com/kiant/articles/295086.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SQL Server 2005/2008 对With Encryption选项创徏的存储过E解?http://www.aygfsteel.com/kiant/articles/294622.html黄小?/dc:creator>黄小?/author>Thu, 10 Sep 2009 09:07:00 GMThttp://www.aygfsteel.com/kiant/articles/294622.htmlhttp://www.aygfsteel.com/kiant/comments/294622.htmlhttp://www.aygfsteel.com/kiant/articles/294622.html#Feedback0http://www.aygfsteel.com/kiant/comments/commentRss/294622.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/294622.html阅读全文

]]>
标量子查?/title><link>http://www.aygfsteel.com/kiant/articles/286847.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Wed, 15 Jul 2009 04:47:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/286847.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/286847.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/286847.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/286847.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/286847.html</trackback:ping><description><![CDATA[<br /> <fieldset><legend>引用: 标量子查?/legend> <p>一个标量子查询是一个放在圆括弧里的普?SELECT查询Q?它只q回只有一个字D늚一行.Q参?Chapter 4 获取有关写查询的信息。) ?SELECT 被执行Q?而其单个q回值将在周围的D辑ּ中用. 把一个返回超q一行或者超q一列的查询用做标量查询是错误的Q?(不过Q在特定的执行中Q子查询不返回行则不错误;标量l果认ؓ?NULLQ?该子查询可以引用周围查询的变量, 那些变量也是在计Q意子查询的时候当做常量用的Q?又见 Section 6.15Q?</p> <p>比如Q下面的查询扑և每个州中的最大h口数量的城市?</p> <p>SELECT name, (SELECT max(pop) FROM cities WHERE cities.state = states.name)<br /> FROM states;</p> </fieldset><br /> <br /> <a target="_blank">子查询作为标量操作数--MySql数据?/a><br /> ps: q种Ҏ(gu)的只能查询单一?br /> <br /> <a target="_blank">《Oracle 高效设计?M思?-标量子查询查询性能讨论 </a><br /> 能提供不思\<br /> <br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff">select</span><span style="color: #000000">     n.ex_name,     c.customer_name,     n.remark,          e.employee_name </span><span style="color: #0000ff">as</span><span style="color: #000000"> create_name,     n.create_user,         n.project_id,   n.id </span><span style="color: #0000ff">as</span><span style="color: #000000"> node_id,         n.model_id,     n.</span><span style="color: #ff00ff">file_id</span><span style="color: #000000">,             g.grade_name </span><span style="color: #0000ff">as</span><span style="color: #000000"> level_name,     t.type </span><span style="color: #0000ff">as</span><span style="color: #000000"> type_name,     <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />         exe.exe_ids,  exe.exe_names,    dept.dept_ids,         dept.dept_names,      <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #ff00ff">Convert</span><span style="color: #000000">(DATE_FORMAT(pn.node_end_time, </span><span style="color: #ff0000">'</span><span style="color: #ff0000">%Yq?c?e?/span><span style="color: #ff0000">'</span><span style="color: #000000">) USING utf8) </span><span style="color: #0000ff">as</span><span style="color: #000000"> end_time     <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">from</span><span style="color: #000000">     hrp_project_execution n <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #ff00ff">left</span><span style="color: #000000"> </span><span style="color: #0000ff">join</span><span style="color: #000000"> hrp_cycle_grade g </span><span style="color: #0000ff">on</span><span style="color: #000000"> g.id </span><span style="color: #808080">=</span><span style="color: #000000"> n.worklevel     <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #ff00ff">left</span><span style="color: #000000"> </span><span style="color: #0000ff">join</span><span style="color: #000000"> hrp_work_type t </span><span style="color: #0000ff">on</span><span style="color: #000000"> t.id </span><span style="color: #808080">=</span><span style="color: #000000"> n.worktype     <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #ff00ff">left</span><span style="color: #000000"> </span><span style="color: #0000ff">join</span><span style="color: #000000"> hrp_customer c </span><span style="color: #0000ff">on</span><span style="color: #000000"> c.id </span><span style="color: #808080">=</span><span style="color: #000000"> n.customer_id     <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #ff00ff">left</span><span style="color: #000000"> </span><span style="color: #0000ff">join</span><span style="color: #000000"> hrp_company_employee_info e </span><span style="color: #0000ff">on</span><span style="color: #000000"> e.id </span><span style="color: #808080">=</span><span style="color: #000000"> n.create_user     <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #ff00ff">left</span><span style="color: #000000"> </span><span style="color: #0000ff">join</span><span style="color: #000000"> hrp_project_node pn </span><span style="color: #0000ff">on</span><span style="color: #000000"> pn.id </span><span style="color: #808080">=</span><span style="color: #000000"> n.node_id<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #ff00ff">left</span><span style="color: #000000"> </span><span style="color: #0000ff">join</span><span style="color: #000000"> (</span><span style="color: #0000ff">select</span><span style="color: #000000"> ne.execution_id, </span><span style="color: #ff00ff">Convert</span><span style="color: #000000">(GROUP_CONCAT(ne.executor_id) USING utf8) </span><span style="color: #0000ff">as</span><span style="color: #000000"> exe_ids,      GROUP_CONCAT(e.employee_name) </span><span style="color: #0000ff">as</span><span style="color: #000000"> exe_names  <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />       </span><span style="color: #0000ff">from</span><span style="color: #000000">  hrp_project_execution_executor ne     <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />       </span><span style="color: #0000ff">inner</span><span style="color: #000000"> </span><span style="color: #0000ff">join</span><span style="color: #000000"> hrp_company_employee_info e </span><span style="color: #0000ff">on</span><span style="color: #000000"> e.id </span><span style="color: #808080">=</span><span style="color: #000000"> ne.executor_id     <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />       </span><span style="color: #0000ff">where</span><span style="color: #000000"> ne.delete_flag </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="font-weight: bold; color: #800000">0</span><span style="color: #000000">       </span><span style="color: #808080">and</span><span style="color: #000000">    ne.execution_id </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="font-weight: bold; color: #800000">46</span><span style="color: #000000">  </span><span style="color: #0000ff">group</span><span style="color: #000000"> </span><span style="color: #0000ff">by</span><span style="color: #000000"> ne.execution_id <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />       ) exe </span><span style="color: #0000ff">on</span><span style="color: #000000"> exe.execution_id </span><span style="color: #808080">=</span><span style="color: #000000"> n.id<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #ff00ff">left</span><span style="color: #000000"> </span><span style="color: #0000ff">join</span><span style="color: #000000"> (</span><span style="color: #0000ff">select</span><span style="color: #000000"> de.exectuion_id, </span><span style="color: #ff00ff">Convert</span><span style="color: #000000">(GROUP_CONCAT(de.deptor_id) USING utf8) </span><span style="color: #0000ff">as</span><span style="color: #000000"> dept_ids,          GROUP_CONCAT(e.employee_name) </span><span style="color: #0000ff">as</span><span style="color: #000000"> dept_names  <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />       </span><span style="color: #0000ff">from</span><span style="color: #000000">  hrp_project_execution_deptor de     <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />       </span><span style="color: #0000ff">inner</span><span style="color: #000000"> </span><span style="color: #0000ff">join</span><span style="color: #000000"> hrp_company_employee_info e </span><span style="color: #0000ff">on</span><span style="color: #000000"> e.id </span><span style="color: #808080">=</span><span style="color: #000000"> de.deptor_id     <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />       </span><span style="color: #0000ff">where</span><span style="color: #000000"> de.delete_flag </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="font-weight: bold; color: #800000">0</span><span style="color: #000000">       </span><span style="color: #808080">and</span><span style="color: #000000">    de.exectuion_id </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="font-weight: bold; color: #800000">46</span><span style="color: #000000">  </span><span style="color: #0000ff">group</span><span style="color: #000000"> </span><span style="color: #0000ff">by</span><span style="color: #000000"> de.exectuion_id<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />       ) dept </span><span style="color: #0000ff">on</span><span style="color: #000000"> dept.exectuion_id </span><span style="color: #808080">=</span><span style="color: #000000"> n.id<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">where</span><span style="color: #000000">    n.id </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="font-weight: bold; color: #800000">46</span></div> <span style="font-size: 8pt"><em>ps. 自己写的部分, 东西镶嵌?left join 部分</em></span> <img src ="http://www.aygfsteel.com/kiant/aggbug/286847.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2009-07-15 12:47 <a href="http://www.aygfsteel.com/kiant/articles/286847.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一个关?联合查询union 和排序order by 的例?/title><link>http://www.aygfsteel.com/kiant/articles/284131.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Thu, 25 Jun 2009 08:27:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/284131.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/284131.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/284131.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/284131.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/284131.html</trackback:ping><description><![CDATA[其实q有更简单的Ҏ(gu) <fieldset><legend>Title</legend> <p>q可以把个别的select命o用圆括号Q这P可以Ҏ(gu)ơ查询以及最l结果做出limit和order by 讄?/p> <p>(select * from tbl1 order by colA limit 10) union (select * from tbl2 order by colA limit 10) order by </p> <p>coltimestamp limit 5</p> </fieldset><br /> <br /> <br /> <br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #808080">//</span><span style="color: #000000">查询有效期内的计划Q务节?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />        string sql </span><span style="color: #808080">=</span><span style="color: #000000"> "</span><span style="color: #0000ff">select</span><span style="color: #000000">     g.grade_name,   "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #ff0000">''</span><span style="color: #000000"> </span><span style="color: #0000ff">as</span><span style="color: #000000"> degree_name,"<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #ff0000">''</span><span style="color: #000000"> </span><span style="color: #0000ff">as</span><span style="color: #000000"> reason, "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #ff0000">'</span><span style="color: #ff0000">project_node</span><span style="color: #ff0000">'</span><span style="color: #000000"> </span><span style="color: #0000ff">as</span><span style="color: #000000"> node_type, "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #ff0000">''</span><span style="color: #000000"> </span><span style="color: #0000ff">as</span><span style="color: #000000"> fact_node_name, "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " p.create_time, "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> "    p.id,    p.project_id,     p.node_name,        p.deptids,"<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> "    p.node_begin_time,         p.node_end_time,    p.worklevel"<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> "    </span><span style="color: #0000ff">from</span><span style="color: #000000">     hrp_project_node p "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> "    </span><span style="color: #ff00ff">left</span><span style="color: #000000"> </span><span style="color: #0000ff">join</span><span style="color: #000000"> hrp_cycle_grade g </span><span style="color: #0000ff">on</span><span style="color: #000000"> g.id </span><span style="color: #808080">=</span><span style="color: #000000"> p.worklevel "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> "    </span><span style="color: #0000ff">where</span><span style="color: #000000"> p.state </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="font-weight: bold; color: #800000">0</span><span style="color: #000000">  </span><span style="color: #808080">and</span><span style="color: #000000">  p.node_state </span><span style="color: #808080"><></span><span style="color: #000000"> </span><span style="font-weight: bold; color: #800000">3</span><span style="color: #000000"> "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #808080">and</span><span style="color: #000000"> UNIX_TIMESTAMP(p.node_begin_time) </span><span style="color: #808080"><</span><span style="color: #000000"> UNIX_TIMESTAMP(</span><span style="color: #ff0000">'</span><span style="color: #ff0000">" + DateTime.Now.ToString() + "</span><span style="color: #ff0000">'</span><span style="color: #000000">) "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">//</span><span style="color: #000000">优先查出所?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">//+</span><span style="color: #000000"> " </span><span style="color: #808080">and</span><span style="color: #000000"> UNIX_TIMESTAMP(p.node_end_time) </span><span style="color: #808080">></span><span style="color: #000000"> UNIX_TIMESTAMP(</span><span style="color: #ff0000">'</span><span style="color: #ff0000">" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "</span><span style="color: #ff0000">'</span><span style="color: #000000">) "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #808080">and</span><span style="color: #000000"> (p.exeids </span><span style="color: #808080">like</span><span style="color: #000000"> </span><span style="color: #ff0000">'</span><span style="color: #ff0000">" + userId + "%</span><span style="color: #ff0000">'</span><span style="color: #000000"> </span><span style="color: #808080">or</span><span style="color: #000000"> p.exeids </span><span style="color: #808080">like</span><span style="color: #000000"> </span><span style="color: #ff0000">'</span><span style="color: #ff0000">%," + userId + "%</span><span style="color: #ff0000">'</span><span style="color: #000000">) ";<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: #808080">//</span><span style="color: #000000">合ƈq未执行的Q务节?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />        sql </span><span style="color: #808080">+=</span><span style="color: #000000"> " </span><span style="color: #0000ff">union</span><span style="color: #000000"> </span><span style="color: #808080">all</span><span style="color: #000000"> "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #0000ff">select</span><span style="color: #000000">     g.grade_name,   "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #ff0000">''</span><span style="color: #000000"> </span><span style="color: #0000ff">as</span><span style="color: #000000"> degree_name,"<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #ff0000">''</span><span style="color: #000000"> </span><span style="color: #0000ff">as</span><span style="color: #000000"> reason, "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #ff0000">'</span><span style="color: #ff0000">fact_node</span><span style="color: #ff0000">'</span><span style="color: #000000"> </span><span style="color: #0000ff">as</span><span style="color: #000000"> node_type, "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #ff0000">''</span><span style="color: #000000"> </span><span style="color: #0000ff">as</span><span style="color: #000000"> fact_node_name, "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " f.create_time, "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> "    f.id,    f.project_id,     f.node_name,        f.deptids,"<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> "    f.fact_begin_time,         f.fact_end_time,    f.worklevel"<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> "    </span><span style="color: #0000ff">from</span><span style="color: #000000">     hrp_fact_node_execute f "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> "    </span><span style="color: #ff00ff">left</span><span style="color: #000000"> </span><span style="color: #0000ff">join</span><span style="color: #000000"> hrp_cycle_grade g </span><span style="color: #0000ff">on</span><span style="color: #000000"> g.id </span><span style="color: #808080">=</span><span style="color: #000000"> f.worklevel "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> "    </span><span style="color: #0000ff">where</span><span style="color: #000000"> f.state </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="font-weight: bold; color: #800000">0</span><span style="color: #000000">  </span><span style="color: #808080">and</span><span style="color: #000000">  f.fact_state_id </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="font-weight: bold; color: #800000">0</span><span style="color: #000000"> "<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #808080">+</span><span style="color: #000000"> " </span><span style="color: #808080">and</span><span style="color: #000000"> (f.exeids </span><span style="color: #808080">like</span><span style="color: #000000"> </span><span style="color: #ff0000">'</span><span style="color: #ff0000">" + userId + "%</span><span style="color: #ff0000">'</span><span style="color: #000000"> </span><span style="color: #808080">or</span><span style="color: #000000"> f.exeids </span><span style="color: #808080">like</span><span style="color: #000000"> </span><span style="color: #ff0000">'</span><span style="color: #ff0000">%," + userId + "%</span><span style="color: #ff0000">'</span><span style="color: #000000">) ";<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />        sql </span><span style="color: #808080">=</span><span style="color: #000000"> string.Format("</span><span style="color: #0000ff">select</span><span style="color: #000000"> </span><span style="color: #808080">*</span><span style="color: #000000"> </span><span style="color: #0000ff">from</span><span style="color: #000000"> ({</span><span style="font-weight: bold; color: #800000">0</span><span style="color: #000000">}) </span><span style="color: #0000ff">as</span><span style="color: #000000"> t1  </span><span style="color: #0000ff">order</span><span style="color: #000000"> </span><span style="color: #0000ff">by</span><span style="color: #000000"> create_time </span><span style="color: #0000ff">desc</span><span style="color: #000000">", sql);</span></div> <br /> <br /> ps: 我记得这L(fng)一帖子好像发表过, 奇怪ؓ什么不找不C??<br /> 当时q参考了别h的博? <br /> qL(fng)ing.... ? ?google.com搞得心神不宁啊~~~~ <img src ="http://www.aygfsteel.com/kiant/aggbug/284131.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2009-06-25 16:27 <a href="http://www.aygfsteel.com/kiant/articles/284131.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle 10g ?SQL Server 2005 的数据类?/title><link>http://www.aygfsteel.com/kiant/articles/233923.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Sun, 12 Oct 2008 16:29:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/233923.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/233923.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/233923.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/233923.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/233923.html</trackback:ping><description><![CDATA[<br /> <br /> <a target="_blank" >Oracle 10g 数据cd</a><br /> <a target="_blank" >SQL Server 2005 的数据类?/a><br /> <br /> <br /> 附录Q?br /> <strong> 1、关?NUMBER(p,s)</strong> Q能表示的有效gؓ 1.0 x 10<sup>-130</sup> to (but not including) 1.0 x 10<sup>126</sup>?br />     pQ精度|指有效位敎ͼ从左边第一个不?的数vQ小数点和负号不计入有效位数。取D围ؓ 0 ?38 ?br />     sQ标度|数点右Ҏ(gu)有效数字位数。取D围ؓ -84 ?127 ?br />       ?s>0Q精到数点右?s 位,q四舍五入?br />       ?s<0Q精到数点左?s 位,q四舍五入?br /> 例如Q?br />     NUMBER(5,3)可以存储的数字Ş式ؓQpp.sss?br /> <br /> ps.<br />     Scale can be greater than precision, most commonly when e notation is used. When scale is greater than precision, the precision specifies the maximum number of significant digits to the right of the decimal point. For example, a column defined as NUMBER(4,5) requires a zero for the first digit after the decimal point and rounds all values past the fifth digit after the decimal point.<br />     ?s > p Ӟ例如 NUMBER(4,5) Q必Lgؓ 0.0xxxx 的数字(数点后 s-p 位加0Q?br /> <br /> CZQ?br /> <table border="0" cellpadding="2" cellspacing="2" height="168" width="713"> <tbody> <tr> <td> 定义格式</td> <td> 输入数?/td> <td> 存储状?/td> </tr> <tr> <td> NUMBER</td> <td> 123.89</td> <td> 123.89</td> </tr> <tr> <td> NUMBER(5)</td> <td> 123.89</td> <td> 124</td> </tr> <tr> <td> NUMBER(5,0)</td> <td> 123456</td> <td> ORA-01438: 值大于ؓ此列指定的允许精?/td> </tr> <tr align="left" valign="middle"> <td> </td> <td> </td> <td> </td> </tr> <tr align="left" valign="middle"> <td> NUMBER(6,2)</td> <td> 123.89</td> <td> 123.89</td> </tr> <tr align="left" valign="middle"> <td> </td> <td> 123.8951</td> <td> 123.9</td> </tr> <tr align="left" valign="middle"> <td> </td> <td> </td> <td> </td> </tr> <tr align="left" valign="middle"> <td> NUMBER(2,5)</td> <td> 0.000811</td> <td> 0.00081</td> </tr> <tr> <td valign="top"><br /> </td> <td valign="top">123.89</td> <td valign="top">ORA-01438: 值大于ؓ此列指定的允许精?/td> </tr> <tr> <td valign="top"><br /> </td> <td valign="top">1.2e-4</td> <td valign="top">0.00012</td> </tr> </tbody> </table> <br /> <img src ="http://www.aygfsteel.com/kiant/aggbug/233923.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2008-10-13 00:29 <a href="http://www.aygfsteel.com/kiant/articles/233923.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JDBC 直连 SQL2005 的一点心?/title><link>http://www.aygfsteel.com/kiant/articles/214637.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Sun, 13 Jul 2008 15:39:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/214637.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/214637.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/214637.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/214637.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/214637.html</trackback:ping><description><![CDATA[<br /> 一、配|?SQL Server 2005 以允许远E连?nbsp;   (通过使用实例名称来运?SQL Server 2005 )<br /> <a target="_blank">http://support.microsoft.com/kb/914277/zh-cn</a> <br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img id="Code_Closed_Image_010749" onclick="this.style.display='none'; Code_Closed_Text_010749.style.display='none'; Code_Open_Image_010749.style.display='inline'; Code_Open_Text_010749.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" /><img id="Code_Open_Image_010749" style="display: none;" onclick="this.style.display='none'; Code_Open_Text_010749.style.display='none'; Code_Closed_Image_010749.style.display='inline'; Code_Closed_Text_010749.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" /><span id="Code_Closed_Text_010749" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255);">摘要&ȝ</span><span id="Code_Open_Text_010749" style="display: none;"><br /> <!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: rgb(0, 0, 0);">在尝试从q程计算接到 Microsoft SQL Server </span><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);"> 实例Ӟ可能会接收到错误消息。在使用ME序q接?nbsp;SQL Server 旉可能会发生此问题。例如,在?nbsp;SQLCMD 实用工具q接?nbsp;SQL Server 时收C下错误消息:<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />Sqlcmd:错误:Microsoft SQL Native Client:建立到服务器的连接时发生错误。连接到 SQL Server </span><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);"> Ӟ默认讄 SQL Server 不允许远E连接这个事实可能会Dp|?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />如果没有?nbsp;SQL Server </span><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);"> 配置为接受远E连接,则可能会发生此问题。默认情况下QSQL Server </span><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);"> Express Edition ?nbsp;SQL Server </span><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);"> Developer Edition 不允许远E连接。若要配|?nbsp;SQL Server </span><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);"> 以允许远E连接,请完成以下所有步骤:<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />     • 在?zhn)要从q程计算接到?nbsp;SQL Server 实例上启用远E连接?nbsp; <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />• 打开 SQL Server Browser 服务?nbsp;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />• 配置防火墙以允许?nbsp;SQL Server ?nbsp;SQL Server Browser 服务相关的网l通讯?nbsp;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />启用 SQL Server Browser 服务<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><strong>如果(zhn)是通过使用实例名称来运?nbsp;SQL Server </strong></span><strong><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);"> q且在连接字W串中没有用特定的 TCP</span><span style="color: rgb(0, 0, 0);">/</span></strong><span style="color: rgb(0, 0, 0);"><strong>IP 端口P则必d?nbsp;SQL Server Browser 服务以允许远E连接?br /> </strong><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />    例如Q?strong> </strong></span><strong><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">计算机名</span><span style="color: rgb(0, 0, 0);">></span></strong><span style="color: rgb(0, 0, 0);"><strong>\SQLEXPRESS 的默认实例名U?/strong>安装?nbsp;SQL Server </span><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);"> Express。不?zhn)正在q行多少?nbsp;SQL Server </span><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);"> 实例Q只需要启用一?nbsp;SQL Server Browser 服务?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />(以下是个人的服务器上的配|,打开?nbsp;TCP</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">IP ?nbsp;实例?<br /> <img alt="同时使用 TCP/IP ?Named Pipes (命名实例?)协议" src="http://www.aygfsteel.com/images/blogjava_net/kiant/2008.07.13/001.jpg" border="0" height="508" width="670" /></span></span></div> <br /> <br /> <br /> <br /> 二、通过 TCP 端口直接?SQL Server 实例 (端口默认值是 1433)<br /> 为SQL Server使用非标准的端口    <a href=" http://www.windbi.com/showtopic-293.aspx" target="_blank">http://www.windbi.com/showtopic-293.aspx</a><br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img id="Code_Closed_Image_010657" onclick="this.style.display='none'; Code_Closed_Text_010657.style.display='none'; Code_Open_Image_010657.style.display='inline'; Code_Open_Text_010657.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" /><img id="Code_Open_Image_010657" style="display: none;" onclick="this.style.display='none'; Code_Open_Text_010657.style.display='none'; Code_Closed_Image_010657.style.display='inline'; Code_Closed_Text_010657.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" /><span id="Code_Closed_Text_010657" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255);">摘要&ȝ</span><span id="Code_Open_Text_010657" style="display: none;"><br /> <!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><strong><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">、ؓC么要?nbsp;TCP</span><span style="color: rgb(0, 0, 0);">/</span></strong><span style="color: rgb(0, 0, 0);"><strong>IP q接</strong><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />    在程序配|文仉QData Source</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">Q服务器的IP地址Q比 Data Source</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">(local) 更有利于UL?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />    </span><strong><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">、服务器端关于标准端?</span><span style="color: rgb(0, 0, 0);">1433</span></strong><span style="color: rgb(0, 0, 0);"><strong>)的更?/strong><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />    当你安装SQL ServerӞ默认实例是监?433端口L(fng)。安全方面容易受到攻凅R?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />    当安装一个命名实例后Q在它启动的时候默认用的是动态决定的端口受因此,命名实例每次启动Ӟ都有可能监听不同的端口号。对于通过防火墙访问方式造成极大问题?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  因此Q?strong>Z限制对你的SQL Server的访问,你需要配|SQL Serverȝ听一个特定的端口</strong>?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />(怎样配置SQL Serverȝ听特定的端口Q示例中使用的是 </span><span style="color: rgb(0, 0, 0);">1433</span><span style="color: rgb(0, 0, 0);">Q你可以自由选择)<br /> <img alt="" src="http://www.aygfsteel.com/images/blogjava_net/kiant/2008.07.13/002A.jpg" border="0" height="608" width="726" /><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <br /> <br /> 3<strong>、用特定端口设|时的客L(fng)q接</strong><br /> 客户端有3U方法连接到一个用特定非标准端口L(fng)实例?br /> <br /> W一U方法是q行SQL Server Browser服务?br /> W二个方法是在客L(fng)机器上创Z个SQL Server的别名?br /> 最后一个方法是在连接字W串里通过~程来指定端口号。Data Source=SERVER2,8484;Initial Catalog=AdventureWorks<br /> <br /> (客户端协?<br /> <img alt="客户端协? src="http://www.aygfsteel.com/images/blogjava_net/kiant/2008.07.13/003.jpg" border="0" height="608" width="727" /><br /> <br /> <br /> <br /> l论<br /> 正如你所看到的,在用一个特定的端口h讄你的SQL Server实例时没有太多的工作要做。最大的问题是保q接字符串的~码要正。当讄端口L(fng)时候,要确保该端口h有被使用?strong>Z保你的环境更加安全Q我你关闭SQL Server Browser服务。这h有的客户端在q接SQL Server的时候都要求指定端口受?br /> </strong></span></span></div> <br /> <br /> <br /> <br /> 三、程序中使用端口q接数据?br /> 在连接到 SQL Server 数据库之前,必须首先在本地计机或服务器上安?SQL ServerQƈ且必d本地计算Z安装 JDBC 驱动E序?br /> <a target="_blank">Microsoft SQL Server 2005 JDBC Driver 1.2 下蝲</a><br /> 使用 JDBC 驱动E序        <a target="_blank">http://msdn.microsoft.com/zh-cn/library/ms378526.aspx</a><br /> 创徏q接 URL                    <a target="_blank">http://msdn.microsoft.com/zh-cn/library/ms378428.aspx</a><br /> myeclicse怎么与sql server 2005q接        <a target="_blank">http://zhidao.baidu.com/question/55043158.html?fr=qrl&test=query</a> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img id="Code_Closed_Image_063305" onclick="this.style.display='none'; Code_Closed_Text_063305.style.display='none'; Code_Open_Image_063305.style.display='inline'; Code_Open_Text_063305.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" /><img id="Code_Open_Image_063305" style="display: none;" onclick="this.style.display='none'; Code_Open_Text_063305.style.display='none'; Code_Closed_Image_063305.style.display='inline'; Code_Closed_Text_063305.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" /><span id="Code_Closed_Text_063305" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255);">摘要&ȝ</span><span id="Code_Open_Text_063305" style="display: none;"><br /> <!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: rgb(0, 0, 0);"><strong>MyEclipse Database Explor 配置</strong>    <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />Driver Template Q在下拉框中选择数据库驱动模ѝ这里这里选择 Microsoft SQL Server </span><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />Driver JARS : dsql jdbc 。点?nbsp;Add JARs 。JDBC包的sqljdbc.jar文g?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />Connection URL:  jdbc:sqlserver:</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">10.0.0.99:1433;databaseName=AdventureWorks </span><span style="color: rgb(0, 128, 0);"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: rgb(0, 0, 0);">                            ?nbsp;jdbc:sqlserver:</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">A9DFC026515C47B\MYSQL;databaseName=AdventureWorks  (已启动SQL Server Browser服务)</span><span style="color: rgb(0, 128, 0);"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: rgb(0, 0, 0);">User name ?nbsp;Password为登陆名字和密码Q?nbsp;好像必须填,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">window w䆾验证</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">无效<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><strong>VS </strong></span><strong><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);"> ?nbsp;SQL </span><span style="color: rgb(0, 0, 0);">2005</span></strong><span style="color: rgb(0, 0, 0);"><strong> 中的配置</strong><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />几乎和MyEclipse Database Explor一P只不q是 端口号前面的 </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">:</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);"> 变成?nbsp;</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />服务器名Uͼ   </span><strong><span style="color: rgb(0, 0, 0);">10.0</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">0.99</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">1433</span></strong><span style="color: rgb(0, 0, 0);"><strong> </strong><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />     <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><strong>与数据库建立单连?/strong><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />若要使用 DriverManager c连接到数据库,必须首先按如下方式注册驱动程序:<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />Class.forName(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">com.microsoft.sqlserver.jdbc.SQLServerDriver</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">); <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />加蝲驱动E序后,可通过使用q接 URL 来徏立连接:<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />String connectionUrl </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">jdbc:sqlserver://localhost:1433;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">   </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">databaseName=AdventureWorks;user=MyUserName;password=*****;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />Connection con </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> DriverManager.getConnection(connectionUrl);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span></span></div> <br /> <br /> <br /> <br /> 四、SQL 2005 更改sa密码<br /> <a target="_blank">http://topic.csdn.net/u/20071130/13/54df9ff6-ad1d-45a3-9d9b-da6a33714227.html</a><br /> 旉匆忙Q没一一验证q?br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img id="Code_Closed_Image_010436" onclick="this.style.display='none'; Code_Closed_Text_010436.style.display='none'; Code_Open_Image_010436.style.display='inline'; Code_Open_Text_010436.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" /><img id="Code_Open_Image_010436" style="display: none;" onclick="this.style.display='none'; Code_Open_Text_010436.style.display='none'; Code_Closed_Image_010436.style.display='inline'; Code_Closed_Text_010436.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" /><span id="Code_Closed_Text_010436" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255);">摘要</span><span id="Code_Open_Text_010436" style="display: none;"><br /> <!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: rgb(0, 0, 0);">企业理里—安全性—̎号—右健属?最好取消密码策略这?<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />sp_password </span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(255, 0, 0);">OldPassword</span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(255, 0, 0);">NewPassword</span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: rgb(0, 0, 255);">alter</span><span style="color: rgb(0, 0, 0);"> login </span><span style="color: rgb(255, 0, 0);">[</span><span style="color: rgb(255, 0, 0);">sa</span><span style="color: rgb(255, 0, 0);">]</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">with</span><span style="color: rgb(0, 0, 0);"> password</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">N</span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(255, 0, 0);">NewPassword</span><span style="color: rgb(255, 0, 0);">'</span><span style="color: rgb(0, 128, 128);">--</span><span style="color: rgb(0, 128, 128);">旧密码可以不用提?/span></span></div> <br /> <img src ="http://www.aygfsteel.com/kiant/aggbug/214637.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2008-07-13 23:39 <a href="http://www.aygfsteel.com/kiant/articles/214637.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">ʡ</a>| <a href="http://" target="_blank">͡</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">°Ͷ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʲ</a>| <a href="http://" target="_blank">ӳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ͼ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">۶</a>| <a href="http://" target="_blank">ػʵ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">С</a>| <a href="http://" target="_blank">̫</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ٲ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͩ®</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ǫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank">ͤ</a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">ݸ</a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>