<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>Database</title>
        <link>http://geekswithblogs.net/sglima/category/11254.aspx</link>
        <description>Database</description>
        <language>pt</language>
        <copyright>Sglima</copyright>
        <managingEditor>sglima@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>How to find locks in sql server 2000</title>
            <link>http://geekswithblogs.net/sglima/archive/2011/06/16/how-to-find-locks-in-sql-server-2000.aspx</link>
            <description>&lt;pre&gt;
/* Processes that are blocking others */
select * from 
sysprocesses
where spid in
(
select 
	blocked
from 
	syslocks l
	inner join sysprocesses p on p.spid=l.spid
where 
	p.dbid=5 -- Database ID
	and p.blocked&amp;lt;&amp;gt;0
)

/* Processes being blocked*/
select 
	p.*
from 
	syslocks l
	inner join sysprocesses p on p.spid=l.spid
where 
	p.dbid=5
	and p.blocked&amp;lt;&amp;gt;0
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/145884.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2011/06/16/how-to-find-locks-in-sql-server-2000.aspx</guid>
            <pubDate>Thu, 16 Jun 2011 16:03:56 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/145884.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2011/06/16/how-to-find-locks-in-sql-server-2000.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/145884.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Linq error: MSDTC on server 'servername' is unavailable</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/08/11/linq-error-msdtc-on-server-servername-is-unavailable.aspx</link>
            <description>&lt;p&gt;Occasionally an application that I am working on throws the above error... &lt;/p&gt;
&lt;p&gt;After trying to fix my code for a bit, and not finding the problem I googled a bit and discovered that this error is caused by a windows service that must be running.&lt;/p&gt;
&lt;p&gt;So, if you ever encounter this error, you must turn on the 'Distributed Transaction Coordinator' in order to solve it.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
Original source: &lt;a href="http://geekswithblogs.net/narent/archive/2006/10/09/93544.aspx"&gt;http://geekswithblogs.net/narent/archive/2006/10/09/93544.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/141277.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/08/11/linq-error-msdtc-on-server-servername-is-unavailable.aspx</guid>
            <pubDate>Wed, 11 Aug 2010 11:39:50 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/141277.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/08/11/linq-error-msdtc-on-server-servername-is-unavailable.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/141277.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to: Update a table from a select</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/07/09/how-to-update-a-table-from-a-select.aspx</link>
            <description>&lt;div&gt;&lt;span style="color: blue; font-size: 10pt"&gt;update&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 10pt"&gt;set&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;span style="color: gray"&gt;    n.&lt;/span&gt;fieldToUpdate&lt;span style="color: gray"&gt;=o&lt;/span&gt;&lt;span style="color: gray"&gt;.&lt;/span&gt;fieldToUpdateFrom &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 10pt"&gt;from&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;   originaltable o &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: gray; font-size: 10pt"&gt;   inner&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: gray"&gt;join&lt;/span&gt; toTable n &lt;span style="color: blue"&gt;on&lt;/span&gt; n&lt;span style="color: gray"&gt;.&lt;/span&gt;id&lt;span style="color: gray"&gt;=&lt;/span&gt; o&lt;span style="color: gray"&gt;.&lt;/span&gt;id&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/140848.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/07/09/how-to-update-a-table-from-a-select.aspx</guid>
            <pubDate>Fri, 09 Jul 2010 13:00:36 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/140848.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/07/09/how-to-update-a-table-from-a-select.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/140848.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to: Change the ownership of an object (MS SQL Server)</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/04/28/how-to-change-the-ownership-of-an-object-ms-sql.aspx</link>
            <description>&lt;p&gt; exec sp_changeobjectowner 'ObjectName', 'newOwner'&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;More info at: &lt;a href="http://msdn.microsoft.com/en-us/library/Aa259618"&gt;http://msdn.microsoft.com/en-us/library/Aa259618&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/139560.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/04/28/how-to-change-the-ownership-of-an-object-ms-sql.aspx</guid>
            <pubDate>Wed, 28 Apr 2010 13:44:20 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/139560.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/04/28/how-to-change-the-ownership-of-an-object-ms-sql.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/139560.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to: Reset table index on SQL Server</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/03/02/how-to-reset-table-index-on-sql-server.aspx</link>
            <description>&lt;p&gt;&lt;span class="Apple-style-span" style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium 'Times New Roman'; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"&gt;&lt;span class="Apple-style-span" style="text-align: justify; line-height: 19px; font-family: monospace; color: rgb(51,51,51); font-size: 12px"&gt;&lt;span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: blue; padding-top: 0px"&gt;DBCC&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; padding-top: 0px"&gt;CHECKIDENT&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: gray; padding-top: 0px"&gt;(&lt;/span&gt;&lt;span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; padding-top: 0px"&gt;yourtable&lt;/span&gt;&lt;span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: gray; padding-top: 0px"&gt;,&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; padding-top: 0px"&gt;reseed&lt;/span&gt;&lt;span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: gray; padding-top: 0px"&gt;,&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; padding-top: 0px"&gt;0&lt;/span&gt;&lt;span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: gray; padding-top: 0px"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;span class="Apple-style-span" style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium 'Times New Roman'; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"&gt;&lt;span class="Apple-style-span" style="text-align: justify; line-height: 19px; font-family: monospace; color: rgb(51,51,51); font-size: 12px"&gt;&lt;span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: gray; padding-top: 0px"&gt;Enjoy :)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/138279.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/03/02/how-to-reset-table-index-on-sql-server.aspx</guid>
            <pubDate>Tue, 02 Mar 2010 16:34:25 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/138279.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/03/02/how-to-reset-table-index-on-sql-server.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/138279.aspx</wfw:commentRss>
        </item>
        <item>
            <title>TimeOuts</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/02/17/timeouts.aspx</link>
            <description>&lt;p&gt;I think it's common knowledge that timeouts can be set on connection strings to ensure that a certain connection doesnt say open for more than SSS seconds.&lt;/p&gt;
&lt;p&gt;What is not so common knowledge is the fact that on a transaction every single command has its own timeout value and if exceded it can bring down the entire transaction. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;So when using transactions take in mind that you can set the connection timeout to 20 minutes, but if a single command that takes a few extra seconds can timeout.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;To prevent this just set a timeout value for the command:&lt;/p&gt;
&lt;p&gt;yourCommand.CommandTimeout = yourTimeOutValueInSeconds;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Enjoy :)&lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/138014.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/02/17/timeouts.aspx</guid>
            <pubDate>Wed, 17 Feb 2010 15:15:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/138014.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/02/17/timeouts.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/138014.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
