??xml version="1.0" encoding="utf-8" standalone="yes"?>久久美女艺术照精彩视频福利播放,国产精品亚洲自拍,久久久亚洲综合http://www.aygfsteel.com/keweibo/zh-cnThu, 01 May 2025 19:05:59 GMTThu, 01 May 2025 19:05:59 GMT60Sqoop&HiveQ解决ERROR hive.HiveConfig: Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly. http://www.aygfsteel.com/keweibo/articles/433143.htmlKeKeTue, 03 Apr 2018 08:56:00 GMThttp://www.aygfsteel.com/keweibo/articles/433143.htmlhttp://www.aygfsteel.com/keweibo/comments/433143.htmlhttp://www.aygfsteel.com/keweibo/articles/433143.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/433143.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/433143.html?$SQOOP_HOME/lib目录下执行以下命?br />
ln -s  /app/soft/apache-hive-2.3.2-bin/lib/hive-exec-2.3.2.jar   hive-exec-2.3.2.jar


Ke 2018-04-03 16:56 发表评论
]]>
旉列{?amp;&动态指定分区Insert数据http://www.aygfsteel.com/keweibo/articles/433141.htmlKeKeMon, 02 Apr 2018 08:47:00 GMThttp://www.aygfsteel.com/keweibo/articles/433141.htmlhttp://www.aygfsteel.com/keweibo/comments/433141.htmlhttp://www.aygfsteel.com/keweibo/articles/433141.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/433141.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/433141.html--然后再Insert表,动态指定分?br />
insert overwrite table partition_user_table partition (dt) select id, account, name, create_time,  from_unixtime(unix_timestamp(create_time,'yyyy/mm/dd'),'yyyymmdd') as dt from external_user_table;


Ke 2018-04-02 16:47 发表评论
]]>
hadoop或hbase集群重启失效节点http://www.aygfsteel.com/keweibo/articles/433135.htmlKeKeFri, 30 Mar 2018 02:44:00 GMThttp://www.aygfsteel.com/keweibo/articles/433135.htmlhttp://www.aygfsteel.com/keweibo/comments/433135.htmlhttp://www.aygfsteel.com/keweibo/articles/433135.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/433135.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/433135.html有时候hadoop或hbase集群q行旉久了后,某些节点׃失效Q这个时候如果不想重启整个集(q种情况在很多情况下已经不被允许Q,q个时候可以单独重启失效节炏V?/span>
HADOOPQ?br style="box-sizing: border-box;" />
hadoop中重启单节点的方法和增加新节点其实是一L?/div>
重启或添加节?/strong>

$bin/hadoop-daemon.sh start datanode 
当然Q添加的话需要copy配置文g到新节点。重启的话先  $bin/hadoop-daemon.sh stop datanode

重新balancer(可?
$bin/hadoop balancer
其实集群自己会balancerQ当然也可以像上面那h动balancerQ不然在J忙时段最好避免?/span>

HBASEQ?/strong>
重启
$bin/hbase-daemon.sh stop regionserver
$bin/hbase-daemon.sh start regionserver

也可以添加新的masterQ默认只有一个masterQ,
$bin/hbase-daemon.sh start master


Ke 2018-03-30 10:44 发表评论
]]>windows下用IDEA开?spark SQL例子报IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URIhttp://www.aygfsteel.com/keweibo/articles/433116.htmlKeKeWed, 21 Mar 2018 03:31:00 GMThttp://www.aygfsteel.com/keweibo/articles/433116.htmlhttp://www.aygfsteel.com/keweibo/comments/433116.htmlhttp://www.aygfsteel.com/keweibo/articles/433116.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/433116.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/433116.html
public class FirstSparkSql {
public static void main(String[] args) {


String masterMode = "local";//spark://master:7077

SparkConf conf = new SparkConf();
//conf.set("spark.executor.memory", "1024m");
conf.setAppName("First Spark SQL");
conf.setMaster(masterMode);
//解决异常Q?/span>IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI
conf.set("spark.sql.warehouse.dir","D:\\temp_files");

JavaSparkContext sc = new JavaSparkContext(conf);

SparkSession spark = SparkSession.builder().config(conf).getOrCreate();
Dataset<Row> df = spark.read().json("hdfs://master:9000/user/spark/input/persons.txt");
df.show();
sc.stop();
}
}


Ke 2018-03-21 11:31 发表评论
]]>
ORA-54033 要修改的列由某个虚拟表达式?/title><link>http://www.aygfsteel.com/keweibo/articles/427353.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Wed, 16 Sep 2015 06:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/keweibo/articles/427353.html</guid><wfw:comment>http://www.aygfsteel.com/keweibo/comments/427353.html</wfw:comment><comments>http://www.aygfsteel.com/keweibo/articles/427353.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/keweibo/comments/commentRss/427353.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/keweibo/services/trackbacks/427353.html</trackback:ping><description><![CDATA[<em style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; font: 14px/21px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; float: left; letter-spacing: normal; color: rgb(153,153,153); word-spacing: 0px; -webkit-text-stroke-width: 0px">原文</em><span style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; display: inline !important; font: 14px/21px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; float: none; letter-spacing: normal; color: rgb(153,153,153); word-spacing: 0px; -webkit-text-stroke-width: 0px"> <span id="wmqeeuq" class="Apple-converted-space"> </span></span><a style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; text-overflow: ellipsis; display: inline-block; font: 14px/21px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; max-width: 69%; white-space: nowrap; letter-spacing: normal; color: rgb(51,51,51); overflow: hidden; word-spacing: 0px; text-decoration: none; -webkit-text-stroke-width: 0px; transition: 0.25s; -webkit-transition: 0.25s" class="cut cut70" >http://blogs.oracle.com/sql/entry/ora_54033_and_the_hidden</a><br /><br /> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">A colleague recently asked me a question:</p> <address style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; display: block; font: 16px/1.5em 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; margin-bottom: 1.5em; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">"I'm modifying the data type of a column. When doing so I get the following error:</p> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">ORA-54033: column to be modified is used in a virtual column expression</p> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">But there's no virtual columns defined on the table! What on earth's going on?!"</p></address> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">This was exceptionally confusing. Looking at the table definition we couldn't see any virtual columns defined: </p><pre style="border-bottom: 1px solid; border-left: 1px solid; padding-bottom: 0.3em; overflow-y: auto; text-transform: none; background-color: rgb(246,246,246); text-indent: 0px; margin: 0px 0px 0.75em; padding-left: 0.3em; padding-right: 0.3em; display: block; font: 12px/1.5em Monaco, Menlo, Consolas, 'Courier New', monospace; word-wrap: break-word; white-space: pre-wrap; letter-spacing: normal; color: rgb(51,51,51); word-break: break-all; border-top: 1px solid; border-right: 1px solid; word-spacing: 0px; padding-top: 0.3em; -webkit-text-stroke-width: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px" class="sql"><span id="wmqeeuq" class="operator"><span style="color: rgb(51,51,51); font-weight: bold" class="keyword">create</span> <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">table</span> tab ( x <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">integer</span>, y <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">date</span>, z varchar2(<span style="color: rgb(0,153,153)" class="number">30</span>) );</span></pre> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Sure enough, when we tried to change the data type of y we got the exception:</p><pre style="border-bottom: 1px solid; border-left: 1px solid; padding-bottom: 0.3em; overflow-y: auto; text-transform: none; background-color: rgb(246,246,246); text-indent: 0px; margin: 0px 0px 1.5em; padding-left: 0.3em; padding-right: 0.3em; display: block; font: 12px/1.5em Monaco, Menlo, Consolas, 'Courier New', monospace; word-wrap: break-word; white-space: pre-wrap; letter-spacing: normal; color: rgb(51,51,51); word-break: break-all; border-top: 1px solid; border-right: 1px solid; word-spacing: 0px; padding-top: 0.3em; -webkit-text-stroke-width: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px" class="prettyprint sql"><span id="wmqeeuq" class="operator"><span style="color: rgb(51,51,51); font-weight: bold" class="keyword">alter</span> <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">table</span> tab modify (y <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">timestamp</span>);</span> ORA-54033: column to be modified is used in a virtual column expression</pre> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">How could this be? </p> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Perhaps there was a column defined that we couldn't see. Querying user_tab_cols revealed something interesting:</p><pre style="border-bottom: 1px solid; border-left: 1px solid; padding-bottom: 0.3em; overflow-y: auto; text-transform: none; background-color: rgb(246,246,246); text-indent: 0px; margin: 0px 0px 1.5em; padding-left: 0.3em; padding-right: 0.3em; display: block; font: 12px/1.5em Monaco, Menlo, Consolas, 'Courier New', monospace; word-wrap: break-word; white-space: pre-wrap; letter-spacing: normal; color: rgb(51,51,51); word-break: break-all; border-top: 1px solid; border-right: 1px solid; word-spacing: 0px; padding-top: 0.3em; -webkit-text-stroke-width: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px" class="prettyprint sql"><span id="wmqeeuq" class="operator"><span style="color: rgb(51,51,51); font-weight: bold" class="keyword">select</span> column_name, data_default, hidden_column <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">from</span> user_tab_cols <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">where</span> table_name = <span style="color: rgb(221,17,68)" class="string">'TAB'</span>;</span> COLUMN_NAME <span style="white-space: pre"> </span>DATA_DEFAULT <span style="white-space: pre"> </span>HID <span style="font-style: italic; color: rgb(153,153,136)" class="comment">------------------------------ <span style="white-space: pre"> </span>----------------------------- ---</span> SYS_STUYPW88OE302TFVBNC6$MMQXE<span style="white-space: pre"> </span>SYS_OP_COMBINED_HASH("X","Y")<span style="white-space: pre"> </span>YES Z<span style="white-space: pre"> </span> NO Y<span style="white-space: pre"> </span>NO X<span style="white-space: pre"> </span>NO</pre> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">The SYS_... column isn't in the table DDL! Where does it come from? And what's SYS_OP_COMBINED_HASH all about? Has someone been mucking around with the database?</p> <div style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">The SYS_ prefix is a sign that the column is system generated. So something's happened that's caused Oracle to create this on our behalf.</p> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">SYS_OP_COMBINED_HASH is an undocumented feature. The name implies Oracle is merging the arguments together to form a hash.</p> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">Is there a feature where we want to capture information about a group of columns?</p></div> <div style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">Indeed there is -extended statistics!This feature enables to Oracle calculate statistics on a group of columns. It uses this information to improve row estimates. This is useful when there's a correlation between the values of two (or more) columns in a table.</p> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">Someone had created extended stats on this table for (x, y).</p></div> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Now we've identified the problem, how do we get around it?</p> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Simple: drop and recreate the extended stats:</p><pre style="border-bottom: 1px solid; border-left: 1px solid; padding-bottom: 0.3em; overflow-y: auto; text-transform: none; background-color: rgb(246,246,246); text-indent: 0px; margin: 0px 0px 1.5em; padding-left: 0.3em; padding-right: 0.3em; display: block; font: 12px/1.5em Monaco, Menlo, Consolas, 'Courier New', monospace; word-wrap: break-word; white-space: pre-wrap; letter-spacing: normal; color: rgb(51,51,51); word-break: break-all; border-top: 1px solid; border-right: 1px solid; word-spacing: 0px; padding-top: 0.3em; -webkit-text-stroke-width: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px" class="prettyprint sql">exec dbms_stats.drop_extended_stats(user, 'tab', '(x, y)'); <span id="wmqeeuq" class="operator"><span style="color: rgb(51,51,51); font-weight: bold" class="keyword">alter</span> <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">table</span> tab modify (y <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">timestamp</span>);</span> <span id="wmqeeuq" class="operator"><span style="color: rgb(51,51,51); font-weight: bold" class="keyword">select</span> dbms_stats.create_extended_stats(<span style="color: rgb(51,51,51); font-weight: bold" class="keyword">user</span>, <span style="color: rgb(221,17,68)" class="string">'tab'</span>, <span style="color: rgb(221,17,68)" class="string">'(x, y)'</span>) <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">from</span> dual;</span> DBMS_STATS.CREATE_EXTENDED_STATS(USER,'TAB','(X,Y)') <span style="font-style: italic; color: rgb(153,153,136)" class="comment">--------------------------------------------------------------------------------</span> SYS_STUYPW88OE302TFVBNC6$MMQXE </pre> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Success!</p> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Extended stats are a great way to improve the optimizer's row estimates. If you need to create these, I recommend you also do the following:</p> <div style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微Y雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"> <ul style="padding-bottom: 0px; line-height: 1.7em; list-style-type: none; margin: 0px 0px 0.75em 25px; padding-left: 0px; padding-right: 0px; font-size: 16px; padding-top: 0px"><li style="line-height: 1.7em; list-style-type: disc; font-size: 16px">Apply the extended stats to all environments</li><li style="line-height: 1.7em; list-style-type: disc; font-size: 16px">Put a comment on the columns explaining what you've done, e.g. </li> <ul style="padding-bottom: 0px; line-height: 1.7em; list-style-type: none; margin: 0px 0px 0px 25px; padding-left: 0px; padding-right: 0px; font-size: 16px; padding-top: 0px"><li style="line-height: 1.7em; list-style-type: disc; font-size: 16px">comment on column tab.x is 'part of extended stats. To modify data type drop and recreate stats';</li></ul></ul>These actions will help prevent future developers getting stuck tracking down the cause of "missing" virtual columns!</div><img src ="http://www.aygfsteel.com/keweibo/aggbug/427353.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/keweibo/" target="_blank">Ke</a> 2015-09-16 14:30 <a href="http://www.aygfsteel.com/keweibo/articles/427353.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JQuery EasyUI combobox动态添加option(?http://www.aygfsteel.com/keweibo/articles/418124.htmlKeKeSat, 20 Sep 2014 07:59:00 GMThttp://www.aygfsteel.com/keweibo/articles/418124.htmlhttp://www.aygfsteel.com/keweibo/comments/418124.htmlhttp://www.aygfsteel.com/keweibo/articles/418124.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/418124.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/418124.html
<input class="easyui-combobox" id="rwlb" name="rwlb" style="width:435px" data-options="valueField:'id', textField:'text', panelHeight:'auto'" >  

Ҏ一Q?/p>

1 var data, json;
2 json = '[{"id":"q计?,"text":"q计?,"selected":true}]';
3 data = $.parseJSON(json);
4 $("#rwlb").combobox("loadData", data);

Ҏ二:

1 var data,json;
2 data = [];
3 data.push({ "text": "试", "id": 100 });
4 $("#rwlb").combobox("loadData", data);
转自Q?a >http://www.cnblogs.com/easypass/archive/2012/12/29/2838329.html

Ke 2014-09-20 15:59 发表评论
]]>
转:Easyui TreeҎ扩展 - getLevel(获取节点U别)http://www.aygfsteel.com/keweibo/articles/417899.htmlKeKeSat, 13 Sep 2014 08:12:00 GMThttp://www.aygfsteel.com/keweibo/articles/417899.htmlhttp://www.aygfsteel.com/keweibo/comments/417899.htmlhttp://www.aygfsteel.com/keweibo/articles/417899.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/417899.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/417899.htmlhttp://www.jeasyuicn.com/the-extended---easyui-tree-method-getlevel-access-node-level.html


Easyui Tree一直就没有提供q个Ҏ,以前没有用到,所以一直没怎么在意,q次自己用到?Z扩展了一个方?分nl大?

1 $.extend($.fn.tree.methods, {
2     getLevel:function(jq,target){
3         var l = $(target).parentsUntil("ul.tree","ul");
4         return l.length+1;
5     }
6 });
用法:
1 var node = $().tree("getSelected");
2 var lv =  $().tree("getLevel",node.target);


Ke 2014-09-13 16:12 发表评论
]]>
oracle 十进制与十六q制的{?/title><link>http://www.aygfsteel.com/keweibo/articles/416374.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Wed, 30 Jul 2014 09:35:00 GMT</pubDate><guid>http://www.aygfsteel.com/keweibo/articles/416374.html</guid><wfw:comment>http://www.aygfsteel.com/keweibo/comments/416374.html</wfw:comment><comments>http://www.aygfsteel.com/keweibo/articles/416374.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/keweibo/comments/commentRss/416374.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/keweibo/services/trackbacks/416374.html</trackback:ping><description><![CDATA[<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; font: 13px/20px georgia, verdana, Arial, helvetica, sans-seriff; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(75,75,75); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">十进制与十六q制的{?br />8i以上版本Q?/p> <p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; font: 13px/20px georgia, verdana, Arial, helvetica, sans-seriff; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(75,75,75); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">十进?->十六q制 <br />select to_char(100,'XX') from dual;</p> <p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; font: 13px/20px georgia, verdana, Arial, helvetica, sans-seriff; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(75,75,75); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">十六q制-->十进?br />select to_number('7D','XX') from dual;</p><br /><span style="color: red">其中XX为格式,注意XX的位C能小?/span>传入的参数?br /><img src ="http://www.aygfsteel.com/keweibo/aggbug/416374.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/keweibo/" target="_blank">Ke</a> 2014-07-30 17:35 <a href="http://www.aygfsteel.com/keweibo/articles/416374.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JavaScript中实现函数重载和参数默认??http://www.aygfsteel.com/keweibo/articles/416152.htmlKeKeThu, 24 Jul 2014 01:22:00 GMThttp://www.aygfsteel.com/keweibo/articles/416152.htmlhttp://www.aygfsteel.com/keweibo/comments/416152.htmlhttp://www.aygfsteel.com/keweibo/articles/416152.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/416152.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/416152.html转自Q?a >http://www.2cto.com/kf/201208/149413.html

参数默认值是指在调用函数Ӟ若省略了某个实参Q函C自动参数分配一个默认|使得函数调用的方便性和灉|性大大提高?/p>

举个例子Q比?a style="color: rgb(51,51,51); font-size: 14px; text-decoration: none" class="keylink" target="_blank">PHP中的字符串截取函数substr(string,start,length)Q当不指定lengthӞ函数默认截取字W串中start位置到字W串l束Q而如果指定了lengthQ则截取从start位置开始的以length为长度的字符Ԍ所以如果调用的是substr('http://www.hualai.net.cn',11,6)Q则q回的是hualaiQ如果省略掉最后一个参敎ͼsubstr('http://www.hualai.net.cn',11)Q则q回hualai.net.cn?/p>

再比如jQuery框架中,$(selector).html()Ҏ是获取该元素内的HTML代码Q?(selector).html(content)则是讄该元素内的HTML。我们知道,在C语言中,我们可以通过如下形式来ؓ函数参数讄默认|

[cpp] 
void foo(int a, int b = 1, bool c = false);   
?a style="color: rgb(51,51,51); font-size: 14px; text-decoration: none" class="keylink" target="_blank">Java中,则可以通过函数重蝲来设|函数参数默认|

[java]
public void foo(int a){   
    foo(a, 1);   
}   
public void foo(int a, int b){   
    foo(a, b, false);   
}   
public void foo(int a, int b, bool c){   
    //函数内容   
}   
而在JavaScript中,如何像jQuery那样讄函数参数默认值呢QJavaScript中ƈ没有像C语言中定义函数时直接在参数后面赋值的ҎQ也没有像Java里那L函数重蝲Q但我们可以通过JavaScriptҎ中的一个arguments只读变量数组来实玎ͼ具体如下Q?/p>

[js] 
function foo(){   
    var a = arguments[0] ? arguments[0] : 1;   
    var b = arguments[1] ? arguments[1] : false;   
    //函数内容   
}   
以上是通过判断参数是否存在Q若不存在则默认值附l变量,而我们可以通过判断参数的类型来实现重蝲Q?/p>

[js] 
function foo(){   
    if(typeof arguments[0] == 'string')    
        alert('参数cd为字W串');    
    else if(typeof arguments[0] == 'number')    
        alert('参数cd为数?);    
}   
或者:

[js] 
function foo(){   
    if(arguments[0].constructor == String)    
        alert('参数cd为字W串');    
    else if(arguments[0].constructor == Number)    
        alert('参数cd为数?);    
}   



Ke 2014-07-24 09:22 发表评论
]]>
SQL Server 2005中的CTE递归查询得到一| (?http://www.aygfsteel.com/keweibo/articles/415936.htmlKeKeThu, 17 Jul 2014 06:46:00 GMThttp://www.aygfsteel.com/keweibo/articles/415936.htmlhttp://www.aygfsteel.com/keweibo/comments/415936.htmlhttp://www.aygfsteel.com/keweibo/articles/415936.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/415936.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/415936.htmlhttp://blog.csdn.net/bin_520_yan/article/details/5998349

感觉q个CTE递归查询蛮好用的Q先举个例子Q?/p>

 

  1. use City;  
  2. go  
  3. create table Tree  
  4. (  
  5.   ID int identity(1,1) primary key not null,  
  6.   Name varchar(20) not null,  
  7.   Parent varchar(20) null  
  8. )  
  9. go  
  10. insert Tree values('大学',null)  
  11. insert Tree values('学院','大学')  
  12. insert Tree values('计算机学?,'学院')  
  13. insert Tree values('|络工程','计算机学?)  
  14. insert Tree values('信息理','计算机学?)  
  15. insert Tree values('电信学院','学院')  
  16. insert Tree values('教务?,'大学')  
  17. insert Tree values('材料U?,'教务?)  
  18. insert Tree values('招生?,'大学')  
  19. go  
  20. with CTE as  
  21. (  
  22. -->Begin 一个定位点成员  
  23.  select ID, Name,Parent,cast(Name as nvarchar(max)) as TE,0 as Levle from Tree where Parent is null  
  24. -->End   
  25. union all  
  26. -->Begin一个递归成员  
  27.  select Tree.ID, Tree.Name,Tree.Parent,cast(replicate(' ',len(CTE.TE))+'|_'+Tree.name as nvarchar(MAX)) as TE,Levle+1 as Levle  
  28.         from Tree inner join CTE  
  29.         on Tree.Parent=CTE.Name  
  30. -->End  
  31. )  
  32. select * from CTE order by ID  
  33. --1.?nbsp;CTE 表达式拆分ؓ定位Ҏ员和递归成员?nbsp; 
  34. --2.q行定位Ҏ员,创徏W一个调用或基准l果?nbsp;(T0)?nbsp; 
  35. --3.q行递归成员Q将 Ti 作ؓ输入(q里只有一条记?Q将 Ti+1 作ؓ输出?nbsp; 
  36. --4.重复步骤 3Q直到返回空集?nbsp; 
  37. --5.q回l果集。这是对 T0 ?nbsp;Tn 执行 UNION ALL 的结果?nbsp; 

 

上面的SQL语句再次插入一条数据:

insert Tree values('|络1?,'|络工程')

     q行l果如下图:

? q行l果

     注意点:貌似在递归成员处所选择的字D都必须Tree表的数据Q而不能是CTEl果集中的除了Tree中没有而CTE中有的字D在q里才可以引用,比如字段TE?/p>

    首先看下Q遍历的W?条记录的SQL语句Q?/p>

  1. select ID, Name,Parent,cast(Name as nvarchar(max)) as TE,0 as Levle from Tree where Parent is null  

 

   获取的结果ؓQ?/p>

   Name  Parent   TE    Levle

-------------------------------------

     大学    NULL   大学     0

   递归W?ơ所获取的结果集合的cSQL语句为:

  1. select Tree.ID, Tree.Name,Tree.Parent,cast(replicate(' ',len(CTE.TE))+'|_'+Tree.name as nvarchar(MAX)) as TE,Levle+1 as Levle  
  2. from Tree inner join  
  3.    (select ID, Name,Parent,cast(Name as nvarchar(max)) as TE,0 as Levle from Tree where Parent is null)  
  4. as CTE  
  5. on Tree.Parent=CTE.Name  

 

   上面的CTE子查询的l果是W一ơ递归查询的结果集Q上面SQLq行l果为:

   同样的,第二次递归查询的上面三条记录作为第三次查询?#8216;定位成员’Q?/p>

  【这里要注意Q上面的三条记录是从最后一条开始依ơ作为第三次递归的输入的Q即W一条是ID=9的记录,接下来是7?Q关于第四次递归也类伹{?/p>

   W三ơ递归cSQL语句

  1. select Tree.ID, Tree.Name,Tree.Parent,cast(replicate(' ',len(CTE.TE))+'|_'+Tree.name as nvarchar(MAX)) as TE,Levle+1 as Levle  
  2. from Tree inner join  
  3. (W二ơ递归查询的SQL语句)as CTE  
  4. on Tree.Parent=CTE.Name  

 

   l果如下Q?/p>

其实每次递归的类SQL可ؓ如下所C:

  1. select Tree.ID, Tree.Name,Tree.Parent,cast(replicate(' ',len(CTE.TE))+'|_'+Tree.name as nvarchar(MAX)) as TE,Levle+1 as Levle  
  2. from Tree inner join  
  3. (上次递归查询的结果集Q仅仅是上次那一ơ的Q而不是以前的dl果?  
  4. as CTE  
  5. on Tree.Parent=CTE.Name  

 

 W四ơ递归一ơ类推,最后所查询的结果ؓ上面所有递归的union?/p>

 l:在上面的SQ语句查询l果中,ID?0的记录应该要攑֜ID?的后面?/p>

 往数据表中再次d两条记录Q?/p>

insert Tree values('计科','计算机学?)
insert Tree values('?,'|络1?) 

再次修改上面的SQL语句Q?/p>

  1. with CTE as    
  2. (     
  3. -->Begin 一个定位点成员     
  4.  select ID, Name,Parent,cast(Name as nvarchar(max)) as TE,  
  5.         ROW_NUMBER()over(order by getdate()) as OrderID  
  6.         --最关键是上面这个字D,要获取排序字D,按字W串来排序?nbsp; 
  7.         --其中H口函数必须要用order byQ但是不能用整型Q那q旉?nbsp; 
  8.         from Tree where Parent is null    
  9. -->End      
  10. union all     
  11. -->Begin一个递归成员     
  12.  select Tree.ID, Tree.Name,Tree.Parent,cast(replicate(' ',len(CTE.TE))+'|_'+Tree.name as nvarchar(MAX)) as TE,  
  13.         CTE.OrderID*100+ROW_NUMBER()over(Order by GETDATE()) as OrderID  
  14.         from Tree inner join CTE     
  15.         on Tree.Parent=CTE.Name     
  16. -->End     
  17. )     
  18. select * from CTE  
  19. order by LTRIM(OrderID)--最后将q个整型数据转换为字W串型的q行排序  
  20.   
  21. --有时候整型可以比大小Q字W串也可以,字符串比的大是一位一位进行字W比较的  
  22. --整型+字符?=整型Q只有字W串+字符?=两个字符串的q和  
  23. --递归查询中:W二条记录可以引用第一条记录的?nbsp; 
  24. --动态加载记录时Q同一个等U的记录识别W:RowNumber()over(order by getdate())  
  25. --延Q可以动态获取某个部门下的所以子部门。也可以获取该部门上U的所以部?nbsp; 
  26.   
  27. --ȝQ首先要拼凑Z个整型数据,然后转换为字W串Q最后是q行字符串的orderQ而不是整型数据的orderQ?nbsp; 

 

最后的l果为:

? q行l果

q样Q无论用h入多条记录都可以进行按部门Q按规律q行查询?/p>

Ke 2014-07-17 14:46 发表评论
]]>
DataTable更新数据操作(?http://www.aygfsteel.com/keweibo/articles/415278.htmlKeKeMon, 30 Jun 2014 07:49:00 GMThttp://www.aygfsteel.com/keweibo/articles/415278.htmlhttp://www.aygfsteel.com/keweibo/comments/415278.htmlhttp://www.aygfsteel.com/keweibo/articles/415278.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/415278.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/415278.html

BLL?nbsp;     

  public void Update(DataTable dt)
        {
            foreach (DataRow dr in dt.Rows)
            {
                if (dr.RowState == DataRowState.Deleted)
                    continue;
                if (dr.RowState == DataRowState.Modified || dr.RowState == DataRowState.Added)
                {
                    if (dr["usr_id"] == DBNull.Value)
                    {
                        throw new Exception("用户代码不能为空");
                    }                }
            }

            dal.Update(dt);
        }

       

DAL?/p>

 public void Update(DataTable dt)
        {
            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlConnection conn = new SqlConnection(SqlHelper.ConnectionString);
            conn.Open();

            adapter.InsertCommand = new SqlCommand("INSERT INTO dbo.t6( com_id ,usr_id ) VALUES( @com_id ,@usr_id)", conn);
            adapter.InsertCommand.CommandType = CommandType.Text;
            adapter.InsertCommand.Parameters.Add("@com_id", SqlDbType.VarChar, 4, "com_id");
            adapter.InsertCommand.Parameters.Add("@usr_id", SqlDbType.VarChar, 8, "usr_id");

            adapter.UpdateCommand = new SqlCommand("update t6 setwhereand usr_id", conn);
            adapter.UpdateCommand.CommandType = CommandType.Text;
            adapter.UpdateCommand.Parameters.Add("@com_id", SqlDbType.VarChar, 4, "com_id");
            adapter.UpdateCommand.Parameters.Add("@usr_id", SqlDbType.VarChar, 8, "usr_id");
            adapter.UpdateCommand.Parameters.Add("@usr_id1", SqlDbType.VarChar, 8, "usr_id");
            adapter.UpdateCommand.Parameters["@usr_id1"].SourceVersion = DataRowVersion.Original;

            adapter.DeleteCommand = new SqlCommand("delete from t6 whereand usr_id", conn);
            adapter.DeleteCommand.CommandType = CommandType.Text;
            adapter.DeleteCommand.Parameters.Add("@com_id", SqlDbType.VarChar, 4, "com_id");
            adapter.DeleteCommand.Parameters.Add("@usr_id", SqlDbType.VarChar, 8, "usr_id");

            adapter.DeleteCommand.Parameters["@com_id"].SourceVersion = DataRowVersion.Original;
            adapter.DeleteCommand.Parameters["@usr_id"].SourceVersion = DataRowVersion.Original;

            adapter.Update(dt);
        }

 

前台

    public partial class DataTableUpdate : Form
    {

        public BLL.Users Bu = new BLL.Users();
        public DataTable dtUsr = new DataTable();
        public MOD.Users modObject = new MOD.Users();

        public string _UserId = "";

        public DataTableUpdate()
        {
            InitializeComponent();
            dataGridView1.AutoGenerateColumns = false;
        }

//H口加蝲

        private void Form1_Load(object sender, EventArgs e)
        {
            dtUsr = Bu.GetList();
            dataGridView1.DataSource = dtUsr;
            BindValue();
        }

        private void BindValue()
        {
            tb_com_id.DataBindings.Add("Text", dataGridView1.DataSource, "com_id");
            tb_UsrId.DataBindings.Add("Text", dataGridView1.DataSource, "usr_id");

            //手动修改可以; 代码赋值需要用下面q句?br />            tb_UsrId.DataBindings[0].DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
        }

        private void 保存_Click(object sender, EventArgs e)
        {
            foreach (DataRow dr in dtUsr.Rows)
            {
                dr.EndEdit();
            }
            try
            {
                Bu.Update(dtUsr);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
            MessageBox.Show("保存成功Q?, "pȝ提示");
        }

        private void 删除_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("您确认要删除用户Q? + tb_UsrName.Text.Trim()+" ?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                return;

            if (dataGridView1.CurrentCell == null)
                return;

            try
            {
                dataGridView1.Rows.Remove(dataGridView1.CurrentRow);
                Bu.Update(dtUsr);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
            MessageBox.Show("删除成功Q?, "pȝ提示");
           
        }

        private void 增加_Click(object sender, EventArgs e)
        {
            DataRow dr = dtUsr.NewRow();
            dr["usr_id"] = _UserId;
            dtUsr.Rows.Add(dr);
            dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0];
        }

        private void 取消_Click(object sender, EventArgs e)
        {
            dtUsr.RejectChanges();
        }
牛铁Q?a style="color: rgb(63,167,203); text-decoration: underline" >http://blog.csdn.net/fangxinggood/archive/2008/04/18/2304047.aspx



Ke 2014-06-30 15:49 发表评论
]]>
在数据表(DataTable)中操作数??http://www.aygfsteel.com/keweibo/articles/415272.htmlKeKeMon, 30 Jun 2014 03:08:00 GMThttp://www.aygfsteel.com/keweibo/articles/415272.htmlhttp://www.aygfsteel.com/keweibo/comments/415272.htmlhttp://www.aygfsteel.com/keweibo/articles/415272.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/415272.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/415272.html转自Q?a >http://blog.csdn.net/cui55/article/details/1371411

?span class="Apple-converted-space"> DataSet 中创?span class="Apple-converted-space"> DataTable 之后Q您执行的活动可以与使用数据库中的表时执行的zd相同。您可以d、查看、编辑和删除表中的数据;可以监视错误和事Ӟq且可以查询表中的数据。在修改 DataTable 中的数据Ӟ您也可以验证更改是否正确Qƈ军_是否以编E方式接受更Ҏ拒绝更改?/p>

本节内容

数据添臌?/font>:说明如何创徏新行q将其添臌中?/p>
在创?span class="Apple-converted-space"> DataTable q用列和约束定义其l构之后Q您可以新的数据行添至表中。要d新行Q可一个新变量声明?span class="Apple-converted-space"> DataRow cd。调?span class="Apple-converted-space"> NewRow ҎӞ返回新?span class="Apple-converted-space"> DataRow 对象。然后,DataTable 会根据表的结构按 DataColumnCollection 的定义创?span class="Apple-converted-space"> DataRow 对象?

以下CZ演示了如何通过调用 NewRow Ҏ来创建新行?/p>

DataRow workRow = workTable.NewRow();

然后您可以用烦引或列名来操作新d的行Q如下例所C?/p>

workRow["CustLName"] = "Smith";
workRow[1] = "Smith";

在将数据插入新行后,Add Ҏ可用于将行添?span class="Apple-converted-space"> DataRowCollectionQ如以下代码所C?/p>

workTable.Rows.Add(workRow);

您也可以通过传入值的数组Q类型化?span class="Apple-converted-space"> ObjectQ,调用 Add Ҏ来添加新行,如下例所C?/p>

workTable.Rows.Add(new Object[] {1, "Smith"});

类型化?span class="Apple-converted-space"> Object 的值的数组传递到 Add ҎQ可在表内创建新行ƈ其列D|ؓ对象数组中的倹{请注意Q数l中的gҎ它们在表中出现的序相与各列匹配?/p>

以下CZ十行添x建的 Customers 表中?/p>

DataRow workRow;

for (int i = 0; i <= 9; i++) 
{
  workRow = workTable.NewRow();
  workRow[0] = i;
  workRow[1] = "CustName" + i.ToString();
  workTable.Rows.Add(workRow);
}

查看表中数据:说明如何讉K行中的数据,包括数据的原始版本和当前版本?/p>
可以使用 DataTable ?span class="Apple-converted-space"> Rows ?span class="Apple-converted-space"> Columns 集合来访?span class="Apple-converted-space"> DataTable 中的内容。也可以Ҏ包括搜烦标准、排序顺序和行状态等特定标准Q?span class="Apple-converted-space"> DataTable.Select Ҏq回 DataTable 中数据的子集。此外,用主键值搜索特定行Ӟq可使用 DataRowCollection ?span class="Apple-converted-space"> Find Ҏ?

DataTable 对象?span class="Apple-converted-space"> Select Ҏq回一l与指定条g匚w?span class="Apple-converted-space"> DataRow 对象?strong>Select 采用{选表辑ּ、排序表辑ּ?span class="Apple-converted-space"> DataViewRowState 的可选参数。筛选表辑ּҎ DataColumn |例如 LastName = 'Smith'。排序表辑ּ遵@用于为列排序的标?SQL U定Q例?span class="Apple-converted-space"> LastName ASC, FirstName ASC。有关编写表辑ּ的规则,请参?strong>DataColumn  Expression 属性?/p>

提示 如果您将?span class="Apple-converted-space"> DataTable ?span class="Apple-converted-space"> Select Ҏ执行多次调用Q可通过先ؓ DataTable 创徏 DataView来提高性能。创?span class="Apple-converted-space"> DataView 会ؓ表中的行~制索引。然后,Select Ҏ会用该索引Q这样将显著~短生成查询l果的时间。有关ؓ DataTable 创徏 DataView 的信息,请参?a style="color: rgb(51,102,153); text-decoration: none" >创徏和?DataView?/blockquote>

Select ҎZ DataViewRowState 定要查看或操作的行的版本。下表说明了可能?span class="Apple-converted-space"> DataViewRowState 枚D倹{?/p>

成员名称 说明
CurrentRows 当前行,包括未更改的行、已d的行和已修改的行?/td>
Deleted 已删除的行?/td>
ModifiedCurrent 当前版本Q它是原始数据的修改版本Q请参阅ModifiedOriginalQ?/td>
ModifiedOriginal 所有已修改行的原始版本。?span class="Apple-converted-space"> ModifiedCurrent Ӟ当前版本可用?/td>
Added 新行?/td>
None 无?/td>
OriginalRows 原始行,包括未更改的行和已删除的行?/td>
Unchanged 未更改的行?/td>

在下面的CZ中,DataSet 对象已经q筛选,q样Q您可以只用其 DataViewRowState 讄?span class="Apple-converted-space"> CurrentRows的行?/p>

DataRow[] currRows = workTable.Select(null, null, DataViewRowState.CurrentRows);

if (currRows.Length < 1 )
  Console.WriteLine("No Current Rows Found");
else
{
  foreach (DataColumn myCol in workTable.Columns)
    Console.Write("/t{0}", myCol.ColumnName);

  Console.WriteLine("/tRowState");

  foreach (DataRow myRow in currRows)
  {
    foreach (DataColumn myCol in workTable.Columns)
      Console.Write("/t{0}", myRow[myCol]);

    Console.WriteLine("/t" + myRow.RowState);
  }
}

Select Ҏ可用于返回具有不?span class="Apple-converted-space"> RowState 值或字段值的行。以下示例返回一个引用所有已删除行的 DataRow数组Qƈq回另一个引用所有已排序行(按照 CustLName 排序Q其?span class="Apple-converted-space"> CustID 列大?5Q的 DataRow 数组?/p>

// Retrieve all deleted rows.
DataRow[] delRows = workTable.Select(null, null, DataViewRowState.Deleted);

// Retrieve rows where CustID > 5, and order by CustLName.
DataRow[] custRows = workTable.Select("CustID > 5", "CustLName ASC");

~辑表中的数?/font>:说明如何修改行中的数据,包括挂v对行的更改,直至验证q接受了的更攏V?/p>
当您?span class="Apple-converted-space"> DataRow 中更改列值时Q所做更改会立即|于行的 Current 状态中。然后,RowState 会设|ؓModifiedQƈ使用 DataRow ?span class="Apple-converted-space"> AcceptChanges ?span class="Apple-converted-space"> RejectChanges Ҏ来接受或拒绝所做更攏V?strong>DataRowq提供了三种可用于在~辑行时行的状态挂LҎ。这些方法是 BeginEdit?strong>EndEdit ?span class="Apple-converted-space"> CancelEdit?

当您直接?span class="Apple-converted-space"> DataRow 中修改列值时Q?strong>DataRow 会?span class="Apple-converted-space"> Current?strong>Default ?span class="Apple-converted-space"> Original 行版本来理列倹{除q些行版本以外,BeginEdit?strong>EndEdit ?span class="Apple-converted-space"> CancelEdit Ҏq用第四个行版本:Proposed?/p>

在执行编辑操作(通过调用 BeginEdit 开始,q且通过使用 EndEdit ?span class="Apple-converted-space"> CancelEdit 或者通过调用AcceptChanges ?span class="Apple-converted-space"> RejectChanges l束Q的q程中,Proposed 行版本会存在?/p>

在编辑操作过E中Q您可以通过计算 DataTable ?span class="Apple-converted-space"> ColumnChanged 事g中的 ProposedValue 来将验证逻辑应用于各列?strong>ColumnChanged 事g保存 DataColumnChangeEventArgsQ可保持Ҏ在更改的列和ProposedValue 的引用。计了值后Q可以对其进行修Ҏ取消~辑。编辑结束时Q行?span class="Apple-converted-space"> Proposed 状态中Ud?/p>

您可以通过调用 EndEdit 来确认编辑,也可以通过调用 CancelEdit 来取消编辑。请注意Q尽?span class="Apple-converted-space"> EndEdit 实已确认您所做的~辑Q但在调?span class="Apple-converted-space"> AcceptChanges 之前Q?strong>DataSet q没有实际接受更攏V另外请注意Q如果在EndEdit ?span class="Apple-converted-space"> CancelEdit ~辑l束之前调用 AcceptChangesQ编辑将会终止,q接?span class="Apple-converted-space"> Current ?span class="Apple-converted-space"> Original 行版本的 Proposed 行倹{调?span class="Apple-converted-space"> RejectChanges 会以同样的方式结束编辑,q放?span class="Apple-converted-space"> Current ?span class="Apple-converted-space"> Proposed 行版本。在调用 AcceptChanges ?span class="Apple-converted-space"> RejectChanges 之后调用 EndEdit ?span class="Apple-converted-space"> CancelEdit 不会起作用,因ؓ~辑已经l束?/p>

以下CZ演示了如何将 BeginEdit ?span class="Apple-converted-space"> EndEdit ?span class="Apple-converted-space"> CancelEdit 一起用。本CZ也会?span class="Apple-converted-space"> ColumnChanged 事g中的 ProposedValueQƈ军_是否取消~辑?/p>

DataTable  workTable  = new DataTable();
workTable.Columns.Add("LastName", typeof(String));

workTable.ColumnChanged += new DataColumnChangeEventHandler(OnColumnChanged);

DataRow workRow = workTable.NewRow();
workRow[0] = "Smith";
workTable.Rows.Add(workRow);

workRow.BeginEdit();
// Causes the ColumnChanged event to write a message and cancel the edit.
workRow[0] = "";     
workRow.EndEdit();

// Displays "Smith, New".
Console.WriteLine("{0}, {1}", workRow[0], workRow.RowState);  


protected static void OnColumnChanged(Object sender, DataColumnChangeEventArgs args)
{
  if (args.Column.ColumnName == "LastName")
    if (args.ProposedValue.ToString() == "")
    {
      Console.WriteLine("Last Name cannot be blank. Edit canceled.");
      args.Row.CancelEdit();
    }
}

行状态与行版?/font>:提供有关行的不同状态的信息?/p>
ADO.NET 用行状态和版本理表中的行。行状态表C的状态。当修改行时Q行版本会维护存储于行中的|包括当前倹{原始值和默认倹{例如,修改了某行中的一列后Q该行会有一?span class="Apple-converted-space"> Modified 的行状态,q且会存在两个行版本Q?strong>CurrentQ包含当前行|?span class="Apple-converted-space"> OriginalQ包含修改该列前的行|?

每个 DataRow 对象都具?span class="Apple-converted-space"> RowState 属性,您可以检查此属性来定行的当前状态。下表给Z对各RowState 枚D值的要说明?/p>

RowState 说明
Unchanged 自上ơ调?span class="Apple-converted-space"> AcceptChanges 之后Q或?span class="Apple-converted-space"> DataAdapter.Fill 创徏了行之后Q未做出qQ何更攏V?/td>
Added 已将行添臌中,但尚未调?span class="Apple-converted-space"> AcceptChanges?/td>
Modified 已更改了行的一些元素?/td>
Deleted 已将该行从表中删除,q且未调用 AcceptChanges?/td>
Detached 对于已经创徏但不属于M DataRowCollection 的行Q设|ؓ Detached。新?span class="Apple-converted-space"> RowState讄?span class="Apple-converted-space"> Detached。通过调用 Add Ҏ新?span class="Apple-converted-space"> DataRow 添至 DataRowCollection 之后Q?strong>RowState 属性的D|ؓ Added?

对于已经使用 Remove ҎQ或是在使用 Delete Ҏ之后使用?span class="Apple-converted-space"> AcceptChanges ҎQ从DataRowCollection 中移除的行,也设|ؓ Detached?/p>

?span class="Apple-converted-space"> DataSet?strong>DataTable ?span class="Apple-converted-space"> DataRow 上调?span class="Apple-converted-space"> AcceptChanges Ӟ会移除行状态ؓ Deleted 的所有行。剩余的行会被赋?span class="Apple-converted-space"> Unchanged 行状态,q且 Original 行版本中的g改写?span class="Apple-converted-space"> Current 行版本倹{调?strong>RejectChanges Ӟ会移除行状态ؓ Added 的所有行。剩余的行会被赋?span class="Apple-converted-space"> Unchanged 的行状态,q且Current 行版本中的g改写?span class="Apple-converted-space"> Original 行版本倹{?/p>

通过用列引用来传?span class="Apple-converted-space"> DataRowVersion 参数Q您可以查看行的不同行版本,如下例所C?/p>

DataRow custRow = custTable.Rows[0];
string custID = custRow["CustomerID", DataRowVersion.Original].ToString();

下表l出了各 DataRowVersion 枚D值的要说明?/p>

DataRowVersion 说明
Current 行的当前倹{如果是?span class="Apple-converted-space"> Deleted ?span class="Apple-converted-space"> RowState 的行Q则不存在此行版本?/td>
Default 特定行的默认行版本?strong>Added?strong>Modified ?span class="Apple-converted-space"> Unchanged 行的默认行版本是Current?strong>Deleted 行的默认行版本是 Original?strong>Detached 行的默认行版本是 Proposed?/td>
Original 行的原始倹{如果是?span class="Apple-converted-space"> Added ?span class="Apple-converted-space"> RowState 的行Q则不存在此行版本?/td>
Proposed 行的倹{在对行q行~辑操作期间Q或对于不属?span class="Apple-converted-space"> DataRowCollection 的行Q存在此行版本?/td>

通过调用 HasVersion Ҏq将 DataRowVersion 作ؓ参数传递,您可以测?span class="Apple-converted-space"> DataRow 是否h特定的行版本。例如,在调?span class="Apple-converted-space"> AcceptChanges 之前Q?code class="ce">DataRow.HasVersion(DataRowVersion.Original) Ҏd的行返?span class="Apple-converted-space"> false?/p>

例如Q以下代码示例显CZ表中所有已删除行的倹{已删除的行没有 Current 行版本,因此在访问列值时必须传?span class="Apple-converted-space"> DataRowVersion.Original?/p>

DataTable catTable = catDS.Tables["Categories"];

DataRow[] delRows = catTable.Select(null, null, DataViewRowState.Deleted);

Console.WriteLine("Deleted rows:/n");

foreach (DataColumn catCol in catTable.Columns)
  Console.Write(catCol.ColumnName + "/t");
Console.WriteLine();

foreach (DataRow delRow in delRows)
{
  foreach (DataColumn catCol in catTable.Columns)
    Console.Write(delRow[catCol, DataRowVersion.Original] + "/t");
  Console.WriteLine();
}

从表中删除行:说明如何从表中移除行?/p>
用于?span class="Apple-converted-space"> DataTable 对象中删?span class="Apple-converted-space"> DataRow 对象的方法有两种Q?strong>DataRowCollection 对象?span class="Apple-converted-space"> Remove Ҏ?strong>DataRow 对象?span class="Apple-converted-space"> Delete Ҏ?strong>Remove Ҏ?span class="Apple-converted-space"> DataRowCollection 中删?span class="Apple-converted-space"> DataRowQ?span class="Apple-converted-space"> Delete Ҏ只将行标Cؓ删除。当应用E序调用 AcceptChanges ҎӞ才会发生实际的删除。通过使用 DeleteQ您可以在实际删除之前先以编E方式检查哪些行标记为删除。如果将行标Cؓ删除Q其 RowState 属性会讄?span class="Apple-converted-space"> Deleted?

在将 DataSet ?span class="Apple-converted-space"> DataTable ?span class="Apple-converted-space"> DataAdapter 和关pd数据源一起用时Q用 DataRow ?span class="Apple-converted-space"> Delete ҎU除行?strong>Delete Ҏ只是?span class="Apple-converted-space"> DataSet ?span class="Apple-converted-space"> DataTable 中将行标Cؓ DeletedQ而不会移除它。?span class="Apple-converted-space"> DataAdapter 在遇到标Cؓ Deleted 的行Ӟ会执行其 DeleteCommand 以在数据源中删除该行。然后,可以用AcceptChanges Ҏ怹U除该行。如果?span class="Apple-converted-space"> Remove 删除该行Q则该行从表中完全U除Q但DataAdapter 不会在数据源中删除该行?/p>

DataRowCollection ?span class="Apple-converted-space"> Remove Ҏ采用 DataRow 作ؓ参数Qƈ其从集合中U除Q如下例所C?/p>

workTable.Rows.Remove(workRow);

作ؓҎQ以下示例演CZ如何调用 DataRow 上的 Delete Ҏ来将?span class="Apple-converted-space"> RowState 改ؓ Deleted?/p>

workRow.Delete();

如果行标记为删除,q且调用 DataTable 对象?span class="Apple-converted-space"> AcceptChanges ҎQ该行就会从 DataTable 中移除。相比之下,如果调用 RejectChangesQ行?span class="Apple-converted-space"> RowState ׃恢复到被标记?span class="Apple-converted-space"> Deleted 之前的状态?/p>

注意 如果 DataRow ?span class="Apple-converted-space"> RowState ?span class="Apple-converted-space"> AddedQ则意味着已将其添臌中,然后其标记?strong>DeletedQ从表中U除?/blockquote>

d和读取行错误信息:说明如何按行插入错误信息Q以用于解决有关应用E序内行中数据的问题?/p>
Z避免在编?span class="Apple-converted-space"> DataTable 中的值时每次发生行错误都必须响应Q可错误信息添臌中,以便以后使用?strong>DataRow 对象通过对各行提?span class="Apple-converted-space"> RowError 属性来支持此功能。将数据添至 DataRow ?span class="Apple-converted-space"> RowError 属性会?strong>DataRow ?span class="Apple-converted-space"> HasErrors 属性标Cؓ true。如?span class="Apple-converted-space"> DataRow ?span class="Apple-converted-space"> DataTable 的组成部分,?span class="Apple-converted-space"> DataRow.HasErrors?span class="Apple-converted-space"> trueQ则 DataTable.HasErrors 属性也?span class="Apple-converted-space"> true。这也适用?span class="Apple-converted-space"> DataTable 所属的 DataSet。ؓ错误做测试时Q可以检?span class="Apple-converted-space"> HasErrors 属性以定错误信息是否已添x有行。如?span class="Apple-converted-space"> HasErrors ?span class="Apple-converted-space"> trueQ则可?span class="Apple-converted-space"> DataTable ?strong>GetErrors Ҏ以便只返回和查有错误的行Q如下例所C?

DataTable  workTable = new DataTable("Customers");
workTable.Columns.Add("CustID", typeof(Int32));
workTable.Columns.Add("Total", typeof(Double));

workTable.RowChanged += new DataRowChangeEventHandler(OnRowChanged);

for (int i = 0; i < 10; i++)
  workTable.Rows.Add(new Object[] {i, i*100});

if (workTable.HasErrors)
{
  Console.WriteLine("Errors In Table " + workTable.TableName);

  foreach (DataRow myRow in workTable.GetErrors())
  {
    Console.WriteLine("CustID = " + myRow["CustID"]);
    Console.WriteLine(" Error = " + myRow.RowError + "/n");
  }
}

protected static void OnRowChanged(Object sender, DataRowChangeEventArgs args)
{
  // Check for zero values.
  if (args.Row["Total"].Equals(0D))
    args.Row.RowError = "Total cannot be 0.";
}

接受或拒l对行的更改:说明如何接受或拒l对行的更改?/p>
在检验过?span class="Apple-converted-space"> DataTable 中的数据所做更改的准确性之后,可?span class="Apple-converted-space"> DataRow?strong>DataTable ?span class="Apple-converted-space"> DataSet ?strong>AcceptChanges Ҏ来接受更改,此方法会?span class="Apple-converted-space"> Current 行D|ؓ Original |q会?span class="Apple-converted-space"> RowState 属性设|ؓ Unchanged。接受或拒绝更改会清除所?span class="Apple-converted-space"> RowError 信息Qƈ?span class="Apple-converted-space"> HasErrors 属性设|ؓ false。接受或拒绝更改q可以媄响在数据源中更新数据。有x多信息,请参?a style="color: rgb(51,102,153); text-decoration: none" >使用 DataAdapter ?DataSet 更新数据?/a>?

如果 DataTable 上存在外键约束,使用 AcceptChanges ?span class="Apple-converted-space"> RejectChanges 接受或拒l的更改׃ҎForeignKeyConstraint.AcceptRejectRule 传播?span class="Apple-converted-space"> DataRow 的子行?/p>

以下CZ查有错误的行Q在适用之处解决错误Q拒l无法解决错误的行。请注意Q对于解决的错误Q?strong>RowErrorg重置为空字符ԌD?span class="Apple-converted-space"> HasErrors 属性设|ؓ false。当解决或拒l了所有的有错误的行时Q就会调?strong>AcceptChanges 来接受对整个 DataTable 的所有更攏V?/p>

if (workTable.HasErrors)
{

  foreach (DataRow errRow in workTable.GetErrors())
  {
    if (errRow.RowError == "Total cannot exceed 1000.")
    {
      errRow["Total"] = 1000;
      errRow.RowError = "";    // Clear the error.
    }
    else
      errRow.RejectChanges();
  }
}

workTable.AcceptChanges();

处理 DataTable 事g:提供可用?span class="Apple-converted-space"> DataTable 的事件的相关信息Q包括修改列值和d或删除行时的事g?/p>
DataTable 对象提供一pd可由应用E序处理的事件。下表说明了 DataTable 事g?
事g 说明
ColumnChanged 在值已成功插入列时发生?/td>
ColumnChanging 在已提交列值时发生?/td>
RowChanged 在已成功~辑表中的行后发生?/td>
RowChanging 当正在更改表中的行时发生?/td>
RowDeleted 在表中的某行已被标记?span class="Apple-converted-space"> Deleted 之后发生?/td>
RowDeleting 在表中的某行被标Cؓ Deleted 之前发生?/td>

以下CZ创徏 4 个事ӞOnColumnChanged?strong>OnColumnChanging?strong>OnRowChanged ?strong>OnRowChanging。这些事件中的每一个都在列或行更改时发生?/p>

workTable.ColumnChanged  += new DataColumnChangeEventHandler(OnColumnChanged);
workTable.ColumnChanging += new DataColumnChangeEventHandler(OnColumnChanging);
workTable.RowChanged     += new DataRowChangeEventHandler(OnRowChanged);
workTable.RowChanging    += new DataRowChangeEventHandler(OnRowChanging);

protected static void OnColumnChanged(object sender, DataColumnChangeEventArgs args)
{
  Console.Write(" ColumnChanged: ");
  Console.Write(args.Column.ColumnName + " changed to '" + args.ProposedValue + "'/n");
}

protected static void OnColumnChanging(object sender, DataColumnChangeEventArgs args)
{
  Console.Write("ColumnChanging: ");
  Console.Write(args.Column.ColumnName + " equals '" + args.Row[args.Column] + 
                    "', changing to '" + args.ProposedValue + "'/n");    
}

protected static void OnRowChanging(object sender, DataRowChangeEventArgs args)
{
  if (args.Action != DataRowAction.Nothing)
    Console.WriteLine("   RowChanging: Action = " + args.Action + ", CustID = " + args.Row["CustID"]);
}

protected static void OnRowChanged(object sender, DataRowChangeEventArgs args)
{
  if (args.Action != DataRowAction.Nothing)
    Console.WriteLine("    RowChanged: Action = " + args.Action + ", CustID = " + args.Row["CustID"]);
}



Ke 2014-06-30 11:08 发表评论
]]>
SQL Server 2000 Split 自定义函?/title><link>http://www.aygfsteel.com/keweibo/articles/406147.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Fri, 08 Nov 2013 08:57:00 GMT</pubDate><guid>http://www.aygfsteel.com/keweibo/articles/406147.html</guid><wfw:comment>http://www.aygfsteel.com/keweibo/comments/406147.html</wfw:comment><comments>http://www.aygfsteel.com/keweibo/articles/406147.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/keweibo/comments/commentRss/406147.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/keweibo/services/trackbacks/406147.html</trackback:ping><description><![CDATA[<div>/****** Object: Function [dbo].[F_SQLSERVER_SPLIT]   Script Date: 2013-10-30 16:21:46 ******/</div><div>USE [ZBP];</div><div>GO</div><div>SET ANSI_NULLS OFF;</div><div>GO</div><div>SET QUOTED_IDENTIFIER ON;</div><div>GO</div><div>CREATE FUNCTION [dbo].[F_SQLSERVER_SPLIT](@Long_str varchar(8000),@split_str varchar(100))    </div><div>RETURNS  @tmp TABLE(        </div><div>    ID          inT     IDENTITY PRIMARY KEY,      </div><div>    short_str   varchar(8000)    </div><div>)    </div><div>AS   </div><div>BEGIN   </div><div>    DECLARE @long_str_Tmp varchar(8000),@short_str varchar(8000),@split_str_length int   </div><div>    SET @split_str_length = LEN(@split_str)    </div><div>    IF CHARINDEX(@split_str,@Long_str)=1 </div><div>         SET @long_str_Tmp=SUBSTRING(@Long_str,@split_str_length+1,LEN(@Long_str)-@split_str_length)</div><div>    ELSE</div><div>         SET @long_str_Tmp=@Long_str</div><div>    IF CHARINDEX(REVERSE(@split_str),REVERSE(@long_str_Tmp))>1    </div><div>        SET @long_str_Tmp=@long_str_Tmp+@split_str    </div><div>    ELSE   </div><div>        SET @long_str_Tmp=@long_str_Tmp    </div><div>    IF CHARINDEX(@split_str,@long_str_Tmp)=0</div><div>        Insert INTO @tmp select @long_str_Tmp </div><div>    ELSE</div><div>        BEGIN</div><div>            WHILE CHARINDEX(@split_str,@long_str_Tmp)>0    </div><div>                BEGIN   </div><div>                    SET @short_str=SUBSTRING(@long_str_Tmp,1,CHARINDEX(@split_str,@long_str_Tmp)-1)    </div><div>                    DECLARE @long_str_Tmp_LEN INT,@split_str_Position_END int   </div><div>                    SET @long_str_Tmp_LEN = LEN(@long_str_Tmp)    </div><div>                    SET @split_str_Position_END = LEN(@short_str)+@split_str_length    </div><div>                    SET @long_str_Tmp=REVERSE(SUBSTRING(REVERSE(@long_str_Tmp),1,@long_str_Tmp_LEN-@split_str_Position_END))</div><div>                    IF @short_str<>'' Insert INTO @tmp select @short_str    </div><div>                END           </div><div>        END</div><div>    RETURN     </div><div>END</div><div>GO</div><div></div><img src ="http://www.aygfsteel.com/keweibo/aggbug/406147.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/keweibo/" target="_blank">Ke</a> 2013-11-08 16:57 <a href="http://www.aygfsteel.com/keweibo/articles/406147.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SQL Server 2000 十六q制与十q制互{Q收藏)http://www.aygfsteel.com/keweibo/articles/406146.htmlKeKeFri, 08 Nov 2013 08:54:00 GMThttp://www.aygfsteel.com/keweibo/articles/406146.htmlhttp://www.aygfsteel.com/keweibo/comments/406146.htmlhttp://www.aygfsteel.com/keweibo/articles/406146.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/406146.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/406146.html十进制{十六q制
/****** Object: Function [dbo].[IntToHex]   Script Date: 2013-10-30 16:22:15 ******/
USE [ZBP];
GO
SET ANSI_NULLS OFF;
GO
SET QUOTED_IDENTIFIER ON;
GO
CREATE FUNCTION [dbo].[IntToHex]
(@IntNum bigint)
RETURNS varchar(16)
AS
BEGIN
declare @Mods bigint, @res varchar(16)
set @res=''
while @IntNum <> 0
begin
set @Mods = @IntNum % 16
if @Mods > 9
set @res = Char(Ascii('A')+@Mods-10)+@res
else
set @res = Cast(@Mods as varchar(4))+@res
set @IntNum = @IntNum/16
end
return @res
END
GO
十六q制转十q制
/****** Object: Function [dbo].[HexToInt]   Script Date: 2013-10-30 16:22:04 ******/
USE [ZBP];
GO
SET ANSI_NULLS OFF;
GO
SET QUOTED_IDENTIFIER ON;
GO
CREATE FUNCTION [dbo].[HexToInt]
(@hex varchar(100))
RETURNS int
AS
BEGIN
Declare @result bigint,@iPos int,@iTmp bigint,@iLoop int,@tmp varchar(16)
    Set @tmp = '0123456789ABCDEF'
    Select @result = 0,@iPos = 0
    While @iPos <   Len(@hex)
    Begin
          Set  @iTmp = 
               CharIndex(substring(@hex,Len(@hex) - @iPos,1),@tmp)-1
          Set @iLoop = 1
          While @iLoop <= @iPos and @iTmp > 0
          begin
              Set @iTmp = @iTmp * 16
              Set @iLoop = @iLoop + 1
          end
          Set @result = @result + @iTmp
          Set @iLoop = @iLoop + 1     
          Set @iPos = @iPos + 1
    End
    return @result
END
GO


Ke 2013-11-08 16:54 发表评论
]]>
存储q程递归调用?游标的用注意事?http://www.aygfsteel.com/keweibo/articles/399268.htmlKeKeTue, 14 May 2013 09:17:00 GMThttp://www.aygfsteel.com/keweibo/articles/399268.htmlhttp://www.aygfsteel.com/keweibo/comments/399268.htmlhttp://www.aygfsteel.com/keweibo/articles/399268.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/399268.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/399268.html注意Q?/span>必须把游标声明ؓ局部的Q即加上local

CREATE PROCEDURE [dbo].[p_expand_k3_bom]
@p_itemID int, @p_levelID int
WITH EXEC AS CALLER
AS
declare @v_itemID int
declare @v_levelID int
declare @v_itemNO varchar(20)
declare @v_itemName varchar(200)
declare @v_itemModel varchar(200)
declare @v_note1 varchar(20)
declare cursor_bom CURSOR LOCAL FOR select b.FItemID,c.FShortNumber, c.FName, c.FModel,  b.FNote1
  from AIS20120110144135.dbo.ICBOM a, AIS20120110144135.dbo.ICBOMChild b, AIS20120110144135.dbo.t_ICItem c
  where a.FInterID = b.FInterID
  and b.FItemID = c.FItemID
  and a.FInterID = (select top 1 FInterID from AIS20120110144135.dbo.ICBOM where FItemID = @p_itemID)
  and a.FItemID = @p_itemID
set @v_levelID = @p_levelID+1
open cursor_bom 
fetch next from cursor_bom into @v_itemID, @v_itemNO, @v_itemName, @v_itemModel, @v_note1
while (@@FETCH_STATUS = 0)
  begin
    INSERT INTO k3_bom_info
      (level_id, item_id, item_no, item_name, item_model, note_1) 
    VALUES (@v_levelID, @v_itemID, @v_itemNO, @v_itemName, @v_itemModel, @v_note1)
    
    exec p_expand_k3_bom @v_itemID, @v_levelID
    
    fetch next from cursor_bom into @v_itemID, @v_itemNO, @v_itemName, @v_itemModel, @v_note1
  end
close cursor_bom
deallocate cursor_bom
GO


Ke 2013-05-14 17:17 发表评论
]]>
Openbravo Developers_Guide Noteshttp://www.aygfsteel.com/keweibo/articles/398701.htmlKeKeFri, 03 May 2013 01:23:00 GMThttp://www.aygfsteel.com/keweibo/articles/398701.htmlhttp://www.aygfsteel.com/keweibo/comments/398701.htmlhttp://www.aygfsteel.com/keweibo/articles/398701.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/398701.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/398701.htmlHow to create a Table
http://wiki.openbravo.com/wiki/How_to_create_a_Table

The new table must include the AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated and UpdatedBy fields that are mandatory and required for security and auditory purposes of the application. 

Each table must have at least one column marked as an identifier. The actual values of identifier columns later get concatenated to be shown to the user as a representation of a particular record (see the link to the Sales Order within the Sales Invoice window). These identifiers will also be used to construct dropdown lists of records of that particular table. By default all columns with column name Name are set as an identifier. In case there is no column with this Name, no identifier is set and needs to be done so manually or compilation will fail. 

NOTE: The columns that are named line or seqNo are used to contain the sequence number of a record (i.e. the number of a line in an invoice). They take a default value like:

@SQL=SELECT COALESCE(MAX(ColumnName),0)+10 AS DefaultValue FROM TableName WHERE xxParentColumn=@xxParentColumn@

The WHERE part of this clause needs to be replaced with the required values. The code that should appear here is the name of the column which links with the id of the parent one. For example, each record of the C_InvoiceLine belongs to a particular C_Invoice record and they are all sequenced. C_Invoice is the parent table for the lines saved in C_InvoiceLine. This table has a column named line and the default value that it takes is:

@SQL=SELECT COALESCE(MAX(LINE),0)+10 AS DefaultValue FROM C_INVOICELINE WHERE C_INVOICE_ID=@C_INVOICE_ID@

How to add Columns to a Table

http://wiki.openbravo.com/wiki/How_to_add_Columns_to_a_Table


These changes can be done in two different locations:

  1. Add columns to the original module (dbprefix HT)
  2. Create a second module (dbprefix HT2) which adds the columns to the first module

The first option can be chosen if the original module author wants to add more columns to his/her module. The second option is possible for anyone as the columns are added by a new module to the existing one which is not changed directly.

The main difference between these two methods is the names which need to be chosen for the columns to comply with the modularity naming rules.

  1. Adding column to same module: Any valid column name can be picked
  2. Via second module: New column name must comply to the pattern EM_<DBPREFIX>_ where <DBPREFIX> must be the dbprefix if the new module contaning the column to be added. In this example: EM_HT2_

How to add a Constraint

http://wiki.openbravo.com/wiki/How_to_add_a_Constraint

In the Application Dictionary || Message window create a new record using the following details:

  • Module Openbravo Howtos 2 as this is the module containing the constraint also.
  • Search key: The search key must be exactly the same as the constraint's one, in this case em_ht2_ht_salary_dates_chk as this is the link between the constraint and the message.
  • Message type: Depending on the type the UI for the message box will be different (green for success, yellow for warning...), in our case we want a red error message box, so we select Error.
  • Message text: It is the user friendly message that will be displayed inside the message box. So let's enter: The Valid To date may not be before the Valid From date

 

 Creating a new instance of a Business Object

http://wiki.openbravo.com/wiki/How_to_work_with_the_Data_Access_Layer#A_.27Hello_World.27_Example

A business object may never be created using the Java new operator. All business objects should be created using the OBProvider factory class:

   // create the object through the factory   final Category bpg = OBProvider.getInstance().get(Category.class);

Hibernate will detect that a business object is new when:

  • the id of the business object is not set
  • when the flag newOBObject is set to true explicitly

So if you want to create a new business object with a specific id (by calling setId(...)) then you explicitly need to call businessObject.setNewOBObject(true). Otherwise, Hibernate will throw an exception ('count of batch update operation....'). 




Ke 2013-05-03 09:23 发表评论
]]>
redhat 9.0,提示Determining IP information for eth0... failed; no link present. Check cable?http://www.aygfsteel.com/keweibo/articles/398679.htmlKeKeThu, 02 May 2013 08:27:00 GMThttp://www.aygfsteel.com/keweibo/articles/398679.htmlhttp://www.aygfsteel.com/keweibo/comments/398679.htmlhttp://www.aygfsteel.com/keweibo/articles/398679.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/398679.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/398679.htmlredhat 9.0,提示Determining IP information for eth0... failed; no link present. Check cable?无法Ȁzȝl设备eth0
我搜的相兌x案ؓQ?nbsp;
?etc/sysconfig/network-scripts/ifcfg-eth 
/etc/sysconfig/networking/devices/ifcfg-eth 其中表示Ethernet adapter的标识数字,一般ؓ0。当为零的时候,是 
/etc/sysconfig/network-scripts/ifcfg-eth0 
/etc/sysconfig/networking/devices/ifcfg-eth0 q两个文件中加入 

check_link_down () { 
return 1; 


Ke 2013-05-02 16:27 发表评论
]]>
具体分析tftp server配置的步??http://www.aygfsteel.com/keweibo/articles/398387.htmlKeKeThu, 25 Apr 2013 06:57:00 GMThttp://www.aygfsteel.com/keweibo/articles/398387.htmlhttp://www.aygfsteel.com/keweibo/comments/398387.htmlhttp://www.aygfsteel.com/keweibo/articles/398387.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/398387.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/398387.html转自Q?a >http://network.51cto.com/art/201009/225534.htm

在Linuxpȝ中,我们依然可以q行tftp server配置的操作。可能对于熟悉窗口操作的朋友Q对于命令操作有些不熟悉Q没关系q里我们来讲解一下Linux 下的tftp-server配置的命令操作。TFTP是用来下载远E文件的最单网l协?它其于UDP协议而实?嵌入式linux的tftp开发环境包括两个方?

一是linux服务器端的tftp-server支持,

二是嵌入式目标系l的tftp-client支持.

因ؓu-boot本n内置支持tftp-client,所以嵌入式目标pȝ端就不用配置?

下面pl介l一下linux服务器端tftp server配置.在redhat 9.0的第三张光盘?有tftp-server的安装rpm?Q?Q?nbsp;      安装

#mount –t iso9660 /dev/hdc /mnt/cdrom    //挂蝲光盘

#rpm -ivh tftp-server-0.32-4.i386.rpm              //安装

#umount /mnt/cdrom                                          //卸蝲光盘

Q?Q修Ҏ件在linux?不管使用的是哪一Usuper-server,inetd或者xinetd,默认情况下TFTP服务是禁用的,所以要修改文g来开启服?

ҎQ?Q的安装Ҏ,可以修改文g/etc/xinetd.d/tftp.主要是设|TFTP服务器的根目?开启服?

修改后的文g如下:

service tftp {

socket_type            =dgram

protocol                  =udp

wait                        =yes

user                        =root

server                     =/usr/sbin/in.tftpd

server_args             =-s /home/app -c

disable                    =no

per_source             =11

cps                         =100 2

flags                       =IPv4

}

说明:修改server_args= -s     <path>    -c,其中<path>处可以改Z的tftp server配置的根目录,参数-s指定chroot,-c指定了可以创建文?

Q?Q创建tftp根目?关闭防火?启动tftp-server.

#mkdir /home/app

#chmod o+w       /home/app

#/etc/init.d/iptables stop        //关闭防火?/p>

#service xinetd restart          //重启 xinetd 服务

重启xinetd服务,因ؓTFTP服务受控与xinetd, xinetd是管服务的服?它是不开端口?

验证一下TFTP是否h?

# netstat -nlp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN 3122/rpc.statd

tcp 0 0 127.0.0.1:32781 0.0.0.0:* LISTEN 4035/xinetd

tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 3103/portmap

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3324/httpd

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3255/sshd

tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3213/cupsd

tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3295/sendmail: acce

tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 3415/0

tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3324/httpd

udp 0 0 0.0.0.0:32768 0.0.0.0:* 3122/rpc.statd

udp 0 0 0.0.0.0:69 0.0.0.0:* 4035/xinetd   ;

可以看到69端口已经打开

udp 0 0 0.0.0.0:69 0.0.0.0:* 4012/in.tftpd

udp 0 0 0.0.0.0:111 0.0.0.0:* 3103/portmap

udp 0 0 0.0.0.0:754 0.0.0.0:* 3122/rpc.statd

udp 0 0 0.0.0.0:631 0.0.0.0:* 3213/cupsd

q样,tftp server配置的启动步骤就完成了?/p>

你可以登陆本机测试以?命o如下:

#tftp     your-ip-address

tftp>get <download file>

tftp>put <upload file>

tftp>q



Ke 2013-04-25 14:57 发表评论
]]>
VCQnafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12..."错误! Q{Q?/title><link>http://www.aygfsteel.com/keweibo/articles/396482.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Fri, 15 Mar 2013 07:04:00 GMT</pubDate><guid>http://www.aygfsteel.com/keweibo/articles/396482.html</guid><wfw:comment>http://www.aygfsteel.com/keweibo/comments/396482.html</wfw:comment><comments>http://www.aygfsteel.com/keweibo/articles/396482.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/keweibo/comments/commentRss/396482.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/keweibo/services/trackbacks/396482.html</trackback:ping><description><![CDATA[<div>朋友~写一个dll,~译时d?/div> <div>"nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12..."错误!</div> <div>后发现是,<span style="color: red"><strong>其创建dll旉择的时不用MFC,而后来工E中又添加了与MFC相关的东?/strong></span>.才引起上q问?</div> <div>采用如下步骤解决此问?</div> <div>1.工E设|中改ؓ"动态用MFC"</div> <div>2.<strong>到C++讄中,看到Preprocessor Definitions~辑框中同时存在_USRDLL和_AFXDLL, 删除_USRDLL卛_</strong>.<br /><br />转自Q?a >http://blog.csdn.net/train_z/article/details/3118754</a><br /><br />认解决了问题,但步?Q我使用的是“静态MFC”</div><img src ="http://www.aygfsteel.com/keweibo/aggbug/396482.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/keweibo/" target="_blank">Ke</a> 2013-03-15 15:04 <a href="http://www.aygfsteel.com/keweibo/articles/396482.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VC: “LoadLibraryW? 不能参?1 从“const char *”{换ؓ“LPCWSTR?/title><link>http://www.aygfsteel.com/keweibo/articles/396408.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Wed, 13 Mar 2013 10:59:00 GMT</pubDate><guid>http://www.aygfsteel.com/keweibo/articles/396408.html</guid><wfw:comment>http://www.aygfsteel.com/keweibo/comments/396408.html</wfw:comment><comments>http://www.aygfsteel.com/keweibo/articles/396408.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/keweibo/comments/commentRss/396408.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/keweibo/services/trackbacks/396408.html</trackback:ping><description><![CDATA[<p>动态调用DLL<br />通过<br />LoadLibrary<br />GetProcAddress<br />FreeLibrary实现?/p> <p>原因 Q工E只支持UNICODE字符</p> <p>解决ҎQ?/p> <p><strong style="color: red">工程属?>配置属?#8211;>常规—>字符?#8212;->使用多字节符字符?/strong></p> <p> </p><img src ="http://www.aygfsteel.com/keweibo/aggbug/396408.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/keweibo/" target="_blank">Ke</a> 2013-03-13 18:59 <a href="http://www.aygfsteel.com/keweibo/articles/396408.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>c++调用c#的dllQ{Q?http://www.aygfsteel.com/keweibo/articles/396322.htmlKeKeTue, 12 Mar 2013 07:13:00 GMThttp://www.aygfsteel.com/keweibo/articles/396322.htmlhttp://www.aygfsteel.com/keweibo/comments/396322.htmlhttp://www.aygfsteel.com/keweibo/articles/396322.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/396322.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/396322.html一、?clr~译MFC可执行文件或规则C# DLL函数.
    1、打开“目属?#8221;对话框,Ҏ是右键单?#8220;解决Ҏ资源理?#8221;中的目q择“属?#8221;?br />    2、展开“配置属?#8221;旁边的节点ƈ选择“常规”。在右侧H格中的“目默认?#8221;下,?#8220;公共语言q行库支?#8221;讄?strong>“公共语言q行库支持(/clrQ?#8221;?br />
    3、在相同的窗gQ确保将“MFC的?#8221;讄?#8220;在共享DLL中用MFC”?br />    4、在“配置属?#8221;下,展开“C/C++”旁边的节点ƈ选择“常规”。请保?#8220;调试信息格式”讄?#8220;E序数据?Zi”Q而不?#8220;/ZI”Q?br />    5、在“配置属?#8221;下,选择“C/C++”Q然后选择“代码生成”。请保?#8220;q行时库”讄?#8220;多线E调试DLLQ?MDdQ?#8221;?#8220;多线EDLLQ?MDQ?#8221;之一?br />二、在代码引用需要的dll.
 using <mscorlib.dll>. 
 using "DownloaFiles.dll"   //换成需要的dll文g?/strong> 
 using namespace SystemQ?
 using namespace ADMessage_testQ?nbsp; //换成dll中类所使用的namespace.
三、在C# DLL函数调用代码前加?pragma managed
    q是manage和unmanage混合~程在MFC下的一U实现方式?br />    以上介绍C++调用C# DLL函数Q希望对你有所帮助?/p>

?、几点要CQ?/p>

  1 使用#using引用C# DLLQ而不?include.我就是想当然的用了后者,所以浪费了一上午的时_

  2 别忘了using namespace CSLibQ?/p>

  3 使用C++/clr语法Q采用正的讉K托管对象Q即Q用帽?#8216;^’Q而不是星?#8216;*’?br />

PSQ附上自己成功运行C++代码

#include "stdafx.h"
#include <iostream>
//#using "..\..\SFCSDLL.dll" //叛_目-->引用...Q添加新引用Q将DLLd到项目中Q可以不用此行代?/p>

using namespace std;
using namespace SFCSDLL;

int _tmain(int argc, _TCHAR* argv[])
{
 Class1 ^c = gcnew Class1();

 c->SFCSDLL_Create_Connection("127.0.0.1", 0, 0, 0, 0);
 c->SFCSDLL_Get_DLLVersion();
 c->SFCSDLL_Close_Connection();

 cout<<"end...";
 system("pause");
 return 0;
}

 



Ke 2013-03-12 15:13 发表评论
]]>
javascript 计算日期相差的天?/title><link>http://www.aygfsteel.com/keweibo/articles/395722.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Tue, 26 Feb 2013 02:00:00 GMT</pubDate><guid>http://www.aygfsteel.com/keweibo/articles/395722.html</guid><wfw:comment>http://www.aygfsteel.com/keweibo/comments/395722.html</wfw:comment><comments>http://www.aygfsteel.com/keweibo/articles/395722.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/keweibo/comments/commentRss/395722.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/keweibo/services/trackbacks/395722.html</trackback:ping><description><![CDATA[<font face="Verdana"><html><br /> <head><br />  <script type="text/javascript"><br />   function moreThanOneMonth(dt)<br />   {<br />    var s1=new Date(dt.replace(/-/g, "/")); //日期格式为yyyy-mm-dd转换成yyyy/mm/dd<br />    var s2=new Date();<br />    var time= s2.getTime() - s1.getTime(); <br />    var days = parseInt(time / (1000 * 60 * 60 * 24));<br />    if(days > 30)<br />     return true;<br />    else<br />     return false;<br />   }<br />   function load(dt)<br />   {<br />    if( checkDate(dt) )<br />    {<br />     alert("days > 30");<br />    }<br />    else<br />    {<br />     alert("days < 30");<br />    }<br />   }<br />  </script><br /> </head><br /> <body onLoad="load('2013-01-01')"><br /> </body><br /></html></font><img src ="http://www.aygfsteel.com/keweibo/aggbug/395722.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/keweibo/" target="_blank">Ke</a> 2013-02-26 10:00 <a href="http://www.aygfsteel.com/keweibo/articles/395722.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C# DataGridView昄行号的方?/title><link>http://www.aygfsteel.com/keweibo/articles/392802.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Tue, 11 Dec 2012 06:54:00 GMT</pubDate><guid>http://www.aygfsteel.com/keweibo/articles/392802.html</guid><wfw:comment>http://www.aygfsteel.com/keweibo/comments/392802.html</wfw:comment><comments>http://www.aygfsteel.com/keweibo/articles/392802.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/keweibo/comments/commentRss/392802.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/keweibo/services/trackbacks/392802.html</trackback:ping><description><![CDATA[<div class="wmqeeuq" id="content" class="content mod-cs-content text-content clearfix"> <div> <p><span>|上最常见的做法是?/span><span>DataGridView</span><span>?/span><span>RowPostPaint</span><span>事g?/span><span>RowHeaderCell</span><span>中绘制行P</span></p> <p><span>private</span><span>void</span><span>dataGridView1_RowPostPaint(</span><span>object</span><span>sender, DataGridViewRowPostPaintEventArgs e)<br />         {<br />            </span><span>try</span><span><br />             {</span></p> <p><span>       e.Graphics.DrawString((e.RowIndex + 1).ToString(), e.InheritedRowStyle.Font, new SolidBrush(Color.CadetBlue), e.RowBounds.Location.X + 15, e.RowBounds.Location.Y + 5);<br />             </span><span>}<br />            </span><span>catch</span><span>(Exception ex)<br />             {<br />                 MessageBox.Show(</span><span>"</span><span>d行号时发生错误,错误信息Q?/span><span>"</span><span>+</span><span>ex.Message, </span><span>"</span><span>操作p|</span><span>"</span><span>);<br />             }<br />         }<br /></span></p> <p><strong><span>但是q种Ҏ在大数据量的时候性能比较差,每次滚动数据都会触发</span><span>RowPostPaint</span><span>事g?/span></strong></p></div></div><img src ="http://www.aygfsteel.com/keweibo/aggbug/392802.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/keweibo/" target="_blank">Ke</a> 2012-12-11 14:54 <a href="http://www.aygfsteel.com/keweibo/articles/392802.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VS2008 自动生成属性的get、set http://www.aygfsteel.com/keweibo/articles/391417.htmlKeKeFri, 16 Nov 2012 01:34:00 GMThttp://www.aygfsteel.com/keweibo/articles/391417.htmlhttp://www.aygfsteel.com/keweibo/comments/391417.htmlhttp://www.aygfsteel.com/keweibo/articles/391417.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/391417.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/391417.html

在VS2008里,也可以像Eclipse那样自动生成get 、setҎ?br />
下面是两个具体操作的ҎQ?br />

1、在~写的字D上单击右键----->重构------->装字段

2、在I白行处Q输?#8220;prop”再按Tab?/p>

Ke 2012-11-16 09:34 发表评论
]]>
如何查看SQL SERVER补丁的版?/title><link>http://www.aygfsteel.com/keweibo/articles/391210.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Mon, 12 Nov 2012 08:19:00 GMT</pubDate><guid>http://www.aygfsteel.com/keweibo/articles/391210.html</guid><wfw:comment>http://www.aygfsteel.com/keweibo/comments/391210.html</wfw:comment><comments>http://www.aygfsteel.com/keweibo/articles/391210.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/keweibo/comments/commentRss/391210.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/keweibo/services/trackbacks/391210.html</trackback:ping><description><![CDATA[<p>原文Q?a >http://hi.baidu.com/einsteinalbert/item/b0366529705c5cfb51fd87ee</a><br /><br />有两U方法:<br /><br /><strong>W一步:使用SQL语句查询</strong><br /><br />select @@version<br /><br />查询l果如下Q?/p> <p>Microsoft SQL Server   2000 - 8.00.2039 (Intel X86) <br />   May   3 2005 23:18:38 <br />   Copyright (c) 1988-2003 Microsoft Corporation<br />   Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 2)</p><br />其实在C:\Program Files\Microsoft SQL Server\MSSQL\Binn\sqlservr.exe<br />点击鼠标右键查看版本也能得到Q不q信息比较简单而已?.00.2039׃表安装的SQL Server的版本了。对应以下的表格Q可以查出来具体对应的补丁版本?strong style="color: #ff0000">8.00.2039表示安装了SP4Q?.00.760表示安装了SP3</strong>?br /><br /><strong>W二步:对照表格查找具体的补丁版?/strong><br /><br /><strong>SQL Server Versions</strong><br /><br />@Version SQL Server Version Released <br /><br />6.50.201 SQL Server 6.5 RTM <br />6.50.213 SQL Server 6.5 with Service Pack 1 <br />6.50.240 SQL Server 6.5 with Service Pack 2 <br />6.50.258 SQL Server 6.5 with Service Pack 3 <br />6.50.281 SQL Server 6.5 with Service Pack 4 <br />6.50.415 SQL Server 6.5 with Service Pack 5 <br />6.50.416 SQL Server 6.5 with Service Pack 5a <br />7.00.623 SQL Server 7.0 / MSDE 1.0 RTM <br />7.00.699 SQL Server 7.0 SP1 July 1999 <br />7.00.842 SQL Server 7.0 SP2 March 20th, 2000 <br />7.00.961 SQL Server 7.0 SP3 December 15th, 2000 <br />7.00.1063 SQL Server 7.0 SP4 <br />8.00.194 SQL Server 2000 RTM <br />8.00.384 SQL Server 2000 SP1 <br />8.00.534 SQL Server 2000 SP2 November 30th, 2001 <br /><strong style="color: #ff0000">8.00.760 SQL Server 2000 SP3 <br />8.00.2039 SQL Server 2000 SP4</strong><strong><br /></strong><br />更多的版本对照表Q?br /><br /><strong>For SQL Server 8</strong><br /><br />Main Releases <br />@@version Version and Service Pack <br />8.00.2039 Service Pack 4<br />8.00.760 Service Pack 3 <br />8.00.534 Service Pack 2 <br />8.00.384 Service Pack 1 <br />8.00.194 RTM <br /><br />All Releases <br />@@version Version and Service Pack <br />8.00.2039 Service Pack 4<br />8.00.760 Service Pack 3 <br />8.00.686 SP 2 + Q316333 <br />8.00.679 SP 2 + Q316333 <br />8.00.665 SP 2 + Q316333 <br />8.00.655 SP 2 + Q316333 <br />8.00.650 SP 2 + Q316333 <br />8.00.644 SP 2 + Q324186 <br />8.00.608 SP 2 + Q316333/Q356326/Q356938 <br />8.00.578 SP 2 + Q316333 <br />8.00.534 Service Pack 2 <br />8.00.532 Service Pack 2 Beta <br />8.00.452 SP 1 + Q308547 <br />8.00.444 SP 1 + Q308547/Q307655 <br />8.00.443 SP 1 + Q307538 <br />8.00.428 SP 1 + Q304850 <br />8.00.384 Service Pack 1 <br />8.00.287 Q297209 <br />8.00.251 Q300194 <br />8.00.250 Q291683 <br />8.00.249 Q288122 <br />8.00.239 Q285290 <br />8.00.233 Q282416 <br />8.00.231 Q282279 <br />8.00.226 Q278239 <br />8.00.225 Q281663 <br />8.00.223 Q280380 <br />8.00.222 Q281769 <br />8.00.218 Q279183 <br />8.00.217 Q279293/Q279296 <br />8.00.211 Q276329 <br />8.00.210 Q275900 <br />8.00.205 Q274330 <br />8.00.204 Q274329 <br />8.00.194 RTM(SQL Server 8 with no service pack applied)<br /><br /><strong>For SQL Server 7</strong><br /><br />Main Releases<br />@@version Version and Service Pack <br />7.00.1063 SQL Server 7 with Service Pack 4 <br />7.00.961 SQL Server 7 with Service Pack 3 <br />7.00.842 SQL Server 7 with Service Pack 2 <br />7.00.699 SQL Server 7 with Service Pack 1 <br />7.00.623 SQL Server 7 with no service pack applied <br /><br /><strong>For SQL Server 6.5</strong><br /><br />Main Releases<br />@@version Version and Service Pack <br />6.50.479 SQL Server 6.5 with Service Pack 5a (updated) <br />6.50.416 SQL Server 6.5 with Service Pack 5a. <br />6.50.415 SQL Server 6.5 with Service Pack 5 <br />6.50.281 SQL Server 6.5 with Service Pack 4 <br />6.50.258 SQL Server 6.5 with Service Pack 3 <br />6.50.240 SQL Server 6.5 with Service Pack 2 <br />6.50.213 SQL Server 6.5 with Service Pack 1 <br />6.50.201 SQL Server 6.5 with no service pack applied <br /><br /><strong>For SQL Server 6</strong><br /><br />Main Releases<br />@@version Version and Service Pack <br />6.00.151 SQL Server 6 with Service Pack 3 <br />6.00.139 SQL Server 6 with Service Pack 2 <br />6.00.124 SQL Server 6 with Service Pack 1 <br />6.00.121 SQL Server 6 with no service pack applied <br /><br /><strong>补充</strong><br />For SQL Server 2005<br />打了sp3后版本号?nbsp;<strong>9.0.4035</strong>如果是这个旧说明不用打了Q如果比q个低,说明没有?img src ="http://www.aygfsteel.com/keweibo/aggbug/391210.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/keweibo/" target="_blank">Ke</a> 2012-11-12 16:19 <a href="http://www.aygfsteel.com/keweibo/articles/391210.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>