<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>zjcxc(邹建)的Blog - SQL Server - 应用实例</title><link>http://blog.csdn.net/zjcxc/category/26826.aspx</link><description /><dc:language>zh-CN</dc:language><lastUpdateTime>Sun, 20 Apr 2008 05:50:00 GMT</lastUpdateTime><ttl>60</ttl><item><dc:creator>邹建</dc:creator><title>乘车线路查询</title><link>http://blog.csdn.net/zjcxc/archive/2008/01/02/2009421.aspx</link><pubDate>Wed, 02 Jan 2008 07:41:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2008/01/02/2009421.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/2009421.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2008/01/02/2009421.aspx#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/2009421.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2009421</trackback:ping><description>之前也有发表过一些如何处理这个问题的方法，但效率不是太好。下面的这种方法加上了乘车方向的考虑：同一条线路上，只有两个乘车方向，而且一旦方向了，就不会再反向乘车（因为是从这个方向来，再坐回去是不合理的）；如果某个站点可以换到另一条线路，则换乘后的另一条线路也是两个方向乘车。通过乘车方向的控制，减少了算法要搜索的路径&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/2009421.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>使用临时表 + 循环展 BOM</title><link>http://blog.csdn.net/zjcxc/archive/2007/08/29/1763598.aspx</link><pubDate>Wed, 29 Aug 2007 13:15:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2007/08/29/1763598.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/1763598.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2007/08/29/1763598.aspx#Feedback</comments><slash:comments>15</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/1763598.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1763598</trackback:ping><description>本文介绍一种展BOM的示例&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/1763598.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>如何控制触发器递归</title><link>http://blog.csdn.net/zjcxc/archive/2007/08/05/1726711.aspx</link><pubDate>Sun, 05 Aug 2007 03:06:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2007/08/05/1726711.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/1726711.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2007/08/05/1726711.aspx#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/1726711.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1726711</trackback:ping><description>如何控制触发器递归:
A表UPDATE后，取B表某列再次UPDATE A表，这样又触发了A表的 UPDATE  触发器，我的目的是只触发一次，是否设置 nested triggers 选项关闭递归触发器即可？&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/1726711.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>实现删除主表数据时, 判断与之关联的外键表是否有数据引用, 有标志, 无则删除</title><link>http://blog.csdn.net/zjcxc/archive/2006/09/18/1236639.aspx</link><pubDate>Mon, 18 Sep 2006 11:30:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2006/09/18/1236639.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/1236639.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2006/09/18/1236639.aspx#Feedback</comments><slash:comments>12</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/1236639.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1236639</trackback:ping><description>某个基础信息表，与系统中30多个表存在外键关系，当删除基础数据时，需要判断是否已经被用过，如果用过则更改标志位，如果没有用过则直接删除，如何能很好实现这个处理？最好能够自动适应表的变化

&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/1236639.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>在有限多的不大于100的正整数中，找出尽量多个相加起来值介于98～102之间的组合</title><link>http://blog.csdn.net/zjcxc/archive/2006/09/17/1233119.aspx</link><pubDate>Sun, 17 Sep 2006 21:00:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2006/09/17/1233119.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/1233119.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2006/09/17/1233119.aspx#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/1233119.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1233119</trackback:ping><description>在有限多的不大于100的正整数中，找出尽量多个相加起来值介于98～102之间的组合。

组合的个数限制在2 和3。

比如有数字（39，40，1，55，17，17……N）数字可以有重复。

找出的组合有（50，50），（21，41，39），（48，50）……M。在上面的数字在组合中每次只能出现一次（比如数字中40只出现过一次，那在组合中也只能出现一次。17出现过两次那在组合中最多两次）
&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/1233119.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>使用事务与锁，实现一个用户取过的数据不被其他用户取到</title><link>http://blog.csdn.net/zjcxc/archive/2006/08/28/1133843.aspx</link><pubDate>Mon, 28 Aug 2006 20:31:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2006/08/28/1133843.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/1133843.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2006/08/28/1133843.aspx#Feedback</comments><slash:comments>9</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/1133843.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1133843</trackback:ping><description>用ADO访问数据库，从一个表中取一定的记录（比如20行），取出后在程序中使用，使用完后删除掉记录（不用更新或删除记录）。在多用户操作下(每个用户采用相同的操作)，怎么保证一个用户已选取的记录不被其他用户选取?

处理这类问题的一般方法是增加一个标志列，每个用户取的记录设置一个标志，新的用户只从标志为未取的记录中获取记录。
而本文利用事务与锁来控制数据的处理，不需要增加任何标志列
&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/1133843.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>如何快速生成100万不重复的8位编号</title><link>http://blog.csdn.net/zjcxc/archive/2006/08/20/1099215.aspx</link><pubDate>Sun, 20 Aug 2006 11:28:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2006/08/20/1099215.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/1099215.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2006/08/20/1099215.aspx#Feedback</comments><slash:comments>19</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/1099215.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1099215</trackback:ping><description>最近在论坛看到有人问，如何快速生成100万不重复的8位编号，对于这个问题，有几点是需要注意的：
1．    如何生成8位随机数，生成的数越随机，重复的可能性当然越小
2．    控制不重复
3．    考虑性能
针对这个问题，我写了如下的示例来解决，希望能为有这类需求的人提供指导
&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/1099215.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>如何实现横向聚合</title><link>http://blog.csdn.net/zjcxc/archive/2006/07/10/898901.aspx</link><pubDate>Mon, 10 Jul 2006 11:38:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2006/07/10/898901.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/898901.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2006/07/10/898901.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/898901.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=898901</trackback:ping><description>SQL Server的聚合函数，只能用在具体的某一列上（纵向使用），现在需要对每条记录的各列做聚合，如何实现呢？&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/898901.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>根据排序定义表排序数据</title><link>http://blog.csdn.net/zjcxc/archive/2005/03/21/325873.aspx</link><pubDate>Mon, 21 Mar 2005 19:08:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2005/03/21/325873.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/325873.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2005/03/21/325873.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/325873.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=325873</trackback:ping><description>对表1中的数据进行排序,排序的规则是根据表2中定义的每类数据每次排序取的记录数,循环排序&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/325873.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>报表统计</title><link>http://blog.csdn.net/zjcxc/archive/2005/03/16/320799.aspx</link><pubDate>Wed, 16 Mar 2005 10:41:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2005/03/16/320799.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/320799.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2005/03/16/320799.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/320799.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=320799</trackback:ping><description>分组逐级统计报表,按预定顺序排序,并且进行各期数据对比&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/320799.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>根据当月数据库自动生成下个月数据库--3</title><link>http://blog.csdn.net/zjcxc/archive/2005/03/16/320782.aspx</link><pubDate>Wed, 16 Mar 2005 10:34:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2005/03/16/320782.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/320782.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2005/03/16/320782.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/320782.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=320782</trackback:ping><description>摘要：每个月的25号，自动创建一个下一个月的database,database名字定为：PosYYYYMM (YYYYMM是年和月，始终是执行操作时间的下一个月) 再将本月database的所有结构（包括表、视图、存储过程等）一模一样的复制到下一个月的database中。不复制任何数据！&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/320782.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>根据当月数据库自动生成下个月数据库--2</title><link>http://blog.csdn.net/zjcxc/archive/2005/03/16/320778.aspx</link><pubDate>Wed, 16 Mar 2005 10:32:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2005/03/16/320778.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/320778.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2005/03/16/320778.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/320778.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=320778</trackback:ping><description>每个月的25号，自动创建一个下一个月的database,database名字定为：PosYYYYMM (YYYYMM是年和月，始终是执行操作时间的下一个月) 再将本月database的所有结构（包括表、视图、存储过程等）一模一样的复制到下一个月的database中。不复制任何数据！&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/320778.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>逐记录导出text/ntext字段值为文本文件</title><link>http://blog.csdn.net/zjcxc/archive/2005/03/16/320682.aspx</link><pubDate>Wed, 16 Mar 2005 09:30:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2005/03/16/320682.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/320682.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2005/03/16/320682.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/320682.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=320682</trackback:ping><description>将表中的text列导出为文本文件,要求每条记录一个文件,文件名根据表中的主键字段自动生成&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/320682.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>随机排序分页处理示例</title><link>http://blog.csdn.net/zjcxc/archive/2005/03/16/320670.aspx</link><pubDate>Wed, 16 Mar 2005 09:18:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2005/03/16/320670.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/320670.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2005/03/16/320670.aspx#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/320670.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=320670</trackback:ping><description>对记录集进行随机排序,然后分页输出结果,要求不同用户进来页面看到的排序都不一样，但是同一个用户在一段时间内每次刷新页面看到的排序都是一样的&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/320670.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>邹建</dc:creator><title>无规律自定义分段的分类汇总+交叉表处理</title><link>http://blog.csdn.net/zjcxc/archive/2005/03/16/320653.aspx</link><pubDate>Wed, 16 Mar 2005 09:02:00 GMT</pubDate><guid>http://blog.csdn.net/zjcxc/archive/2005/03/16/320653.aspx</guid><wfw:comment>http://blog.csdn.net/zjcxc/comments/320653.aspx</wfw:comment><comments>http://blog.csdn.net/zjcxc/archive/2005/03/16/320653.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.csdn.net/zjcxc/comments/commentRss/320653.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=320653</trackback:ping><description>根据自定义类别的分类区间,实现分类汇总及交叉表处理&lt;img src ="http://blog.csdn.net/zjcxc/aggbug/320653.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>