<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/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>怡红公子</title>
        <link>http://blog.joycode.com/luke/Default.aspx</link>
        <description>无我原非你.从他不解伊.肆行无碍凭来去.茫茫着甚悲愁喜,纷纷说甚亲疏密.从前碌碌却因何,到如今.回头试想真无趣</description>
        <language>af</language>
        <copyright>luke</copyright>
        <managingEditor>luke@webservice.com.cn</managingEditor>
        <generator>Joycode Version 1.0.0.0</generator>
        <image>
            <title>怡红公子</title>
            <url>http://www.joycode.com/images/luke/gravatar.aspx</url>
            <link>http://blog.joycode.com/luke/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>DBA的神兵利器——DMVs and DMFs（一）</title>
            <link>http://blog.joycode.com/luke/archive/2008/01/22/114095.aspx</link>
            <description>摘要：&amp;nbsp;在SQL Server 2000的时候，我们要想做Performance Tuning的时候，多半都必须用到Profiler或者SQL Tracer来跟踪，这东西一是结果分析起来麻烦，二是对系统资源消耗太大。在SQL Server 2005中，提供了动态管理视图和函数(Dynamic Management Views and Dynamic Management Functions)，大大的方便了我们对系统运行情况的监控，故障诊断和性能优化。现在除了Debug以外，已经很少再对生产系统使用Pr...[&lt;a href=/luke/archive/2008/01/22/114095.aspx&gt;阅读全文&lt;/a&gt;]&lt;img src="http://blog.joycode.com/luke/aggbug/114095.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2008/01/22/114095.aspx</guid>
            <pubDate>Tue, 22 Jan 2008 10:25:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/114095.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2008/01/22/114095.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/114095.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/114095.aspx</trackback:ping>
        </item>
        <item>
            <title>对属性表中多个属性的匹配查询</title>
            <link>http://blog.joycode.com/luke/archive/2007/12/07/112369.aspx</link>
            <description>摘要：昨天有同事问我一个SQL语句，估计在不少地方会用到，所以在这里分享一下。
有一个对象，每个对象有0到N个属性，根据数据库设计的3NF，我们会设计一个这样的表
CREATE TABLE [dbo].[Objects](&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;
&amp;nbsp;[ObjectID] [int] NOT NULL PRIMARY KEY,&lt;o:p&gt;&lt;/o:p&gt;...[&lt;a href=/luke/archive/2007/12/07/112369.aspx&gt;阅读全文&lt;/a&gt;]&lt;img src="http://blog.joycode.com/luke/aggbug/112369.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2007/12/07/112369.aspx</guid>
            <pubDate>Fri, 07 Dec 2007 05:23:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/112369.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2007/12/07/112369.aspx#feedback</comments>
            <slash:comments>9</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/112369.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/112369.aspx</trackback:ping>
        </item>
        <item>
            <title>TechEd 2007 小收获</title>
            <link>http://blog.joycode.com/luke/archive/2007/11/12/111307.aspx</link>
            <description>http://blog.myspace.cn/1300316663/archive/2007/11/12/400072804.aspx&lt;img src="http://blog.joycode.com/luke/aggbug/111307.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2007/11/12/111307.aspx</guid>
            <pubDate>Mon, 12 Nov 2007 10:29:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/111307.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2007/11/12/111307.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/111307.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/111307.aspx</trackback:ping>
        </item>
        <item>
            <title>MySpace招聘SQL专家</title>
            <link>http://blog.joycode.com/luke/archive/2007/06/25/104596.aspx</link>
            <description>摘要：MySpace招聘SQL专家，待遇超过Microsoft China，GTSC更加不在话下:p 如果您认为在下述方面有专长，请积极报名：　　 
1、工作地点：北京； 2、需要有VLDB或高并发数据库实战经验； 3、熟悉Microsoft SQLServer Database engine，了解Index, Lock等 4、有简单的英文沟通能力（至少技术方面要能够交流），可以去美国出差，最好会开车，在美国不会开车很不方便，而我就不会:'(5、熟悉Replication优先 6、熟悉SSIS优先 
请把个...[&lt;a href=/luke/archive/2007/06/25/104596.aspx&gt;阅读全文&lt;/a&gt;]&lt;img src="http://blog.joycode.com/luke/aggbug/104596.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2007/06/25/104596.aspx</guid>
            <pubDate>Mon, 25 Jun 2007 03:36:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/104596.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2007/06/25/104596.aspx#feedback</comments>
            <slash:comments>29</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/104596.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/104596.aspx</trackback:ping>
        </item>
        <item>
            <title>sp_spaceused2</title>
            <link>http://blog.joycode.com/luke/archive/2006/05/17/75896.aspx</link>
            <description>摘要：&amp;nbsp;
我常用sp_spaceused来查看表所占的空间大小，可是一次只能看一个对象的。今天有空写了个sp_spaceused2，可以同时看全部表的空间大小。
功能
显示当前数据库中某个类型表的行数、由它保留和使用的磁盘空间。
语法
sp_spaceused2 [[@type=] 'type']&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[,[@updateusage =] 'updateusage']
参数
[@type =] 'type'
是要显示的表的类型名称。可以是下列对...[&lt;a href=/luke/archive/2006/05/17/75896.aspx&gt;阅读全文&lt;/a&gt;]&lt;img src="http://blog.joycode.com/luke/aggbug/75896.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2006/05/17/75896.aspx</guid>
            <pubDate>Wed, 17 May 2006 02:38:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/75896.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2006/05/17/75896.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/75896.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/75896.aspx</trackback:ping>
        </item>
        <item>
            <title>导入Excel数据文件的数据类型问题</title>
            <link>http://blog.joycode.com/luke/archive/2006/04/29/75305.aspx</link>
            <description>http://www.sql-club.com/Sunwei/archive/2006/04/26/536.aspx&lt;img src="http://blog.joycode.com/luke/aggbug/75305.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2006/04/29/75305.aspx</guid>
            <pubDate>Sat, 29 Apr 2006 05:59:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/75305.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2006/04/29/75305.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/75305.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/75305.aspx</trackback:ping>
        </item>
        <item>
            <title>SQL 2005中的架构搜索次序</title>
            <link>http://blog.joycode.com/luke/archive/2006/04/29/75304.aspx</link>
            <description>在 SQL Server 2000 中，首先检查的是当前用户所拥有的架构，然后是 DBO 拥有的架构。在 SQL Server 2005 中，每个用户都有一个默认架构，用于指定服务器在解析对象的名称时将要搜索的第一个架构。可以使用 CREATE USER 和 ALTER USER 的 DEFAULT_SCHEMA 选项设置和更改默认架构。如果未定义 DEFAULT_SCHEMA，则数据库用户将把 DBO 作为其默认架构。&lt;img src="http://blog.joycode.com/luke/aggbug/75304.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2006/04/29/75304.aspx</guid>
            <pubDate>Sat, 29 Apr 2006 05:57:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/75304.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2006/04/29/75304.aspx#feedback</comments>
            <slash:comments>8</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/75304.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/75304.aspx</trackback:ping>
        </item>
        <item>
            <title>关于master中的系统存储过程使用的database</title>
            <link>http://blog.joycode.com/luke/archive/2006/01/10/70228.aspx</link>
            <description>摘要：今天邹建问我一个问题，系统存储过程中的查询是在用户数据库中执行的，但是用户自己建立的存储过程却是在master中执行的(都是在master中建立的存储过程)。例如：use masterexec sp_helptext 'sp_spaceused'拿到sp_spaceused的代码，把名字改为sp_spaceused2，再执行一次建立这个存储过程。如：use masterGOSET QUOTED_IDENTIFIER ON GOSET ANSI_NULLS OFF GO
create procedure ...[&lt;a href=/luke/archive/2006/01/10/70228.aspx&gt;阅读全文&lt;/a&gt;]&lt;img src="http://blog.joycode.com/luke/aggbug/70228.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2006/01/10/70228.aspx</guid>
            <pubDate>Tue, 10 Jan 2006 05:58:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/70228.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2006/01/10/70228.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/70228.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/70228.aspx</trackback:ping>
        </item>
        <item>
            <title>SQL Server 2005的锁授予是FIFO的吗？(翻译)</title>
            <link>http://blog.joycode.com/luke/archive/2006/01/06/70039.aspx</link>
            <description>摘要：原作(Wei.Xiao)很多人都认为SQL Server的锁授予是FIFO(先进先出)以避免饥饿问题(又叫哲学家问题)的。想想吧，你在超市等待结帐的时候，如果别人可以随便插队的话，你还能离开超市吗？
我的朋友Santtu 是一个lock manager的专家，他告诉我SQL Server做得比这要聪明。FIFO有一个缺点，它并不总是允许最大的并发度。SQL Server 2005的lock manager就做到了在避免饥饿的情况下允许了尽可能大的并发度。
举个例子说明：Transaction T1在表...[&lt;a href=/luke/archive/2006/01/06/70039.aspx&gt;阅读全文&lt;/a&gt;]&lt;img src="http://blog.joycode.com/luke/aggbug/70039.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2006/01/06/70039.aspx</guid>
            <pubDate>Fri, 06 Jan 2006 01:39:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/70039.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2006/01/06/70039.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/70039.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/70039.aspx</trackback:ping>
        </item>
        <item>
            <title>字符串索引的改进暨使用unicode字符类型的一个理由</title>
            <link>http://blog.joycode.com/luke/archive/2005/09/21/63778.aspx</link>
            <description>摘要：在SQL 2005中，字符串索引支持模糊匹配，如like '%abc%'的查询。在SQL 2000中，字符串索引仅支持前导匹配，如like 'abc%'的查询。
这样不仅是在搜索时能够查找较少的page，更重要的是，SQL查询优化器能够准确的得到EstimateRows，就可以选择最适合的index，而SQL2000就只能瞎蒙。
不过呢，我在测试中发现这样的优化貌似不支持中文，于是和Access Method的人一起跟了一下，最后发现必须要是unicode类型的才能够支持中文。该问题已经提交为bug，...[&lt;a href=/luke/archive/2005/09/21/63778.aspx&gt;阅读全文&lt;/a&gt;]&lt;img src="http://blog.joycode.com/luke/aggbug/63778.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2005/09/21/63778.aspx</guid>
            <pubDate>Wed, 21 Sep 2005 03:58:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/63778.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2005/09/21/63778.aspx#feedback</comments>
            <slash:comments>10</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/63778.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/63778.aspx</trackback:ping>
        </item>
        <item>
            <title>SQL 2005中的临时表和表变量 </title>
            <link>http://blog.joycode.com/luke/archive/2005/09/21/63777.aspx</link>
            <description>摘要：

在SQL 2005中，临时表和表变量的使用和以往没有什么区别。不过呢，新的SQL OS还是为我们带来了一些内部的变化。
在SQL2000里面，如果执行计划关系到动态对象，如表变量、触发器等，计划就不会被缓存SQL2005能缓存这些计划，避免了每次的重编译。
tempdb会缓存临时表和表变量(@t, #t)
而且SQL 2005对tempdb的改动比较大，也会提高临时表的性能，具体细节我不介绍了，不过呢，有两点建议：增加tempdb的大小，增加tempdb的文件数目(至少和CPU数目相同)。...[&lt;a href=/luke/archive/2005/09/21/63777.aspx&gt;阅读全文&lt;/a&gt;]&lt;img src="http://blog.joycode.com/luke/aggbug/63777.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2005/09/21/63777.aspx</guid>
            <pubDate>Wed, 21 Sep 2005 03:56:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/63777.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2005/09/21/63777.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/63777.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/63777.aspx</trackback:ping>
        </item>
        <item>
            <title>也谈Partition的实际应用 </title>
            <link>http://blog.joycode.com/luke/archive/2005/09/21/63776.aspx</link>
            <description>摘要：为什么要说也呢？请参见http://www.sql-club.com/net2004/archive/2005/09/13/199.aspx
Partition一直就是一个很难用于实际应用的功能。为什么呢？选择分区字段是一个关键。必须要能使数据均匀的分散到不同的物理存储，又能使分区字段能够包含查询条件。在smaple中大多是以ID或者Time作为分区字段，但是实际应用中，大部分查询都不会在这两个字段上。以MSN为例，我登录的时候，要查询where username = 'luke@hotmail.com...[&lt;a href=/luke/archive/2005/09/21/63776.aspx&gt;阅读全文&lt;/a&gt;]&lt;img src="http://blog.joycode.com/luke/aggbug/63776.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2005/09/21/63776.aspx</guid>
            <pubDate>Wed, 21 Sep 2005 03:55:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/63776.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2005/09/21/63776.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/63776.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/63776.aspx</trackback:ping>
        </item>
        <item>
            <title>SQL Server 2000 Wait Types </title>
            <link>http://blog.joycode.com/luke/archive/2005/09/21/63775.aspx</link>
            <description>内容有点长，只放个链接。
http://www.sql-club.com/luke/articles/160.aspx&lt;img src="http://blog.joycode.com/luke/aggbug/63775.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2005/09/21/63775.aspx</guid>
            <pubDate>Wed, 21 Sep 2005 03:51:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/63775.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2005/09/21/63775.aspx#feedback</comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/63775.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/63775.aspx</trackback:ping>
        </item>
        <item>
            <title>[SQL 2005]Checksum的作用 </title>
            <link>http://blog.joycode.com/luke/archive/2005/09/21/63774.aspx</link>
            <description>摘要：在SQL 2005中，建立新数据库时，checksum是默认选项，它可以提高硬件的可靠性。
使用DBCC CHECKDB ('database_name' | database_id) WITH PHYSICAL_ONLY 就可以检查checksum是否正确。当然，不用WITH PHYSICAL_ONLY 也行，不过会检查更多的东西，速度也会降低。
要关闭Checksum，可以使用ALTER DATABASE database_nameSET PAGE_VERIFY NONE，或者使用ALTER DA...[&lt;a href=/luke/archive/2005/09/21/63774.aspx&gt;阅读全文&lt;/a&gt;]&lt;img src="http://blog.joycode.com/luke/aggbug/63774.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2005/09/21/63774.aspx</guid>
            <pubDate>Wed, 21 Sep 2005 03:49:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/63774.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2005/09/21/63774.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/63774.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/63774.aspx</trackback:ping>
        </item>
        <item>
            <title>News about Microsoft SQL Server 2005 (Code name Yukon)</title>
            <link>http://blog.joycode.com/luke/archive/2005/03/31/46732.aspx</link>
            <description>最近太懒，好久没写东西了，不过现在要开始动起来了:)
3月初MSDN Subscription发布了Yukon Feb CTP，预计5月发布Beta3，9月发布RTM
而且现在国内已经开始实际应用Yukon了，我会陆续post一些文章和经验的:)&lt;img src="http://blog.joycode.com/luke/aggbug/46732.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>luke</dc:creator>
            <guid>http://blog.joycode.com/luke/archive/2005/03/31/46732.aspx</guid>
            <pubDate>Thu, 31 Mar 2005 08:02:00 GMT</pubDate>
            <wfw:comment>http://blog.joycode.com/luke/comments/46732.aspx</wfw:comment>
            <comments>http://blog.joycode.com/luke/archive/2005/03/31/46732.aspx#feedback</comments>
            <slash:comments>10</slash:comments>
            <wfw:commentRss>http://blog.joycode.com/luke/comments/commentRss/46732.aspx</wfw:commentRss>
            <trackback:ping>http://blog.joycode.com/luke/services/trackbacks/46732.aspx</trackback:ping>
        </item>
    </channel>
</rss>