<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4318562544068519860</atom:id><lastBuildDate>Sun, 05 Oct 2025 17:16:13 +0000</lastBuildDate><category>SQL Server</category><category>.NET 2.0</category><category>.NET3.5</category><category>.net</category><category>ASP.NET</category><category>Automatic Properties</category><category>Formatting Date</category><category>MySQL 5.4</category><category>SQL Server delete</category><category>Visual Studio 2008</category><category>check box</category><category>cross site scripting</category><category>datagridview</category><category>default column values</category><category>default constraints</category><category>delete internals</category><category>help authoring tool</category><category>hide form</category><category>new features</category><category>sql server internals</category><category>sql server storage</category><title>BYPsoft on .NET &amp;amp; SQL</title><description>BYPsoft will share .NET experience on this blog with other community members. We will try to collect all interesting topics about .NET, SQL Server, MySQL, database comparison, database differences and much more.</description><link>http://bypsoft.blogspot.com/</link><managingEditor>noreply@blogger.com (DLM@BYPsoft)</managingEditor><generator>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-865144969168737424</guid><pubDate>Fri, 27 Apr 2012 19:20:00 +0000</pubDate><atom:updated>2012-04-27T12:28:00.199-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">delete internals</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">SQL Server delete</category><category domain="http://www.blogger.com/atom/ns#">sql server internals</category><category domain="http://www.blogger.com/atom/ns#">sql server storage</category><title>How SQL Server deletes records - DELETE internals</title><description>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I was surprised with the fact that a lot of developers don&#39;t know that SQL Server does not perform immediate delete of their DELETE command, but it is doing an a background thread called GHOST CLEANUP periodically. When row delete is requested by transaction, that row is being just marked as &quot;ghosted&quot; and left to the background process to actually removes data. Thus, performances are enhanced and in case of ROLLBACK less work is done.&amp;nbsp; In a system table &lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;sys.dm_exec_requests&lt;span style=&quot;color: black;&quot;&gt; you can periodically notice appearance of the GHOST CLEANUP as command.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;So, let&#39;s see what SLQ Server actually does when we are executing&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;DELETE FROM &amp;nbsp;MyTable &lt;mytable&gt;WHERE ...&lt;/mytable&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;At the beginning let&#39;s create test table and insert couple of records.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;CREATE TABLE [dbo].[DeleteInternals](&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[Id] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[Name] [char](4) NOT NULL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;insert into DeleteInternals([Name]) values(&#39;Row1&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;insert into DeleteInternals([Name]) values(&#39;Row2&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;insert into DeleteInternals([Name]) values(&#39;Row3&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;insert into DeleteInternals([Name]) values(&#39;Row4&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;To discover internals of the table structure, we will use undocumented commands DBCC IND and DBCC PAGE which are heavily used internally in SQL Server but they are not documented and not supported which means you are using them at your own risk.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;To find out which page IDs to look at with DBCC PAGE we are executing&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: red;&quot;&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;DBCC IND(TestDatabase, DeleteInternals, 1)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: red;&quot;&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibrF-NqPFlLQ3EKno9S7-VL3JKrQThJbkMCv8TQWDpSEsvoyq3B5LOIFbbHGC-pbCLetXCJgGgkfUInIXwQGG2yvdCRZyJkPEIdktJTrdmlBxeFh6aj5QRrzBqj6TY1yXX5Oag65bwVX8/s1600/page.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibrF-NqPFlLQ3EKno9S7-VL3JKrQThJbkMCv8TQWDpSEsvoyq3B5LOIFbbHGC-pbCLetXCJgGgkfUInIXwQGG2yvdCRZyJkPEIdktJTrdmlBxeFh6aj5QRrzBqj6TY1yXX5Oag65bwVX8/s1600/page.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: red;&quot;&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Some important fileds for us in the output are&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;PageFID - the file ID of the page&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;PagePID - the page number in the file&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;OBjectID - the ID of the object which page is part of&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;IndexID - &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;the ID of the index which page is part of&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;PageType - where 1 = Data Page, 2 = Index Page&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;IndexLevel - as SQL Server uses doubly-linked lists in a B-Tree for indexes, the data are actually leaf level (level 0) of the clustered index.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;In order to get output back to the console from DBCC commands we need to turn on T3604&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;DBCC TRACEON(3604)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;DBCC PAGE(TestDatabase, 1,399,1)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is output from this command:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuMENnHM3Q8613EdBshOgULaZdLLjEdUP2QiWAWWTyHkVshRykQ9B7SBnPwWerv73Mp7WJVo_yE2Z31MtJNFdkpELK4nWsz0xCNkDqmr4NL7UGTN6wC1zsh9spuFahwGmUUVraV-_VgSI/s1600/page1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuMENnHM3Q8613EdBshOgULaZdLLjEdUP2QiWAWWTyHkVshRykQ9B7SBnPwWerv73Mp7WJVo_yE2Z31MtJNFdkpELK4nWsz0xCNkDqmr4NL7UGTN6wC1zsh9spuFahwGmUUVraV-_VgSI/s1600/page1.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Important stuff for our example here are following records marked in a red square):&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; line-height: 18px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;m_slotCnt = 4 - which shows number of records on the page&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; line-height: 18px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;m_GhostRecCnt = 0 - count of &quot;ghosted&quot; records&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; line-height: 18px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;RecordType = PRIMARY_RECORD for a Slot1 where &quot;Row2&quot; data is located which we will delete later on&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;line-height: 18px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Row - Offset table - offsets for all records.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; line-height: 18px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;After executing DELETE command we will take a look at a page structure again. But, to prevent GHOST CLEANUP process to execute and cleans our page we will&amp;nbsp;enclose&amp;nbsp;DELETE command in a transaction which we will not commit for some time:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;begin transaction&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;delete from DeleteInternals where Id = 2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Let&#39;s take a look at page content:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;DBCC PAGE(TestDatabase, 1,399,1)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbc73gW6Wn13dwH36CNURDbJmlqbaTuTXR7j-YFSb9VRh_4JkV70pf6LD_jEYNbIpvr7JohM6dYqkWClLPmsiLgkVPKeCiuK9HQ2pyF6OTbR0tfGZMJY0jlIxyaP9mibQ24p7sEn1hF3E/s1600/pageghost.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbc73gW6Wn13dwH36CNURDbJmlqbaTuTXR7j-YFSb9VRh_4JkV70pf6LD_jEYNbIpvr7JohM6dYqkWClLPmsiLgkVPKeCiuK9HQ2pyF6OTbR0tfGZMJY0jlIxyaP9mibQ24p7sEn1hF3E/s1600/pageghost.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;We still have 4 records (m_slotCnt) but we can notice now that we have one &quot;ghosted&quot; record, m_ghostRecCnt = 1. That record is exactly our &quot;Row2&quot; which is marked now as GHOST_DATA_RECORD (RecordType). Row - Offset table remains unchanged.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; orphans: 2; text-align: left; text-indent: 0px; widows: 2;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;After&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;committing&lt;/span&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&amp;nbsp;transaction by executing&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; widows: 2;&quot;&gt;commit&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; widows: 2;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; widows: 2;&quot;&gt;and inspecting again page structure&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; widows: 2;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; widows: 2;&quot;&gt;&lt;span style=&quot;line-height: normal; text-align: -webkit-auto;&quot;&gt;DBCC PAGE(TestDatabase, 1,399,1)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; widows: 2;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJHyTA19jGg2p8SZxLS_AroT3F4hm4901BzWe7jPP8Au3VcZ2McNI6KK1dAKXiYVzQEZnjyAbC7LaY_1wvOkrKfFVmUg5w1XK7weh3zuoVaOyLXFxhCxhnXYIhe22Mz-Z5kNOoGcc8MrE/s1600/pagecommit.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJHyTA19jGg2p8SZxLS_AroT3F4hm4901BzWe7jPP8Au3VcZ2McNI6KK1dAKXiYVzQEZnjyAbC7LaY_1wvOkrKfFVmUg5w1XK7weh3zuoVaOyLXFxhCxhnXYIhe22Mz-Z5kNOoGcc8MrE/s1600/pagecommit.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; display: inline !important; float: none; font-family: Arial, Helvetica, sans-serif; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; widows: 2;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;We see now, after committing transaction that number of records is equal 3 (m_slotCnt = 3) and number of &quot;ghosted&quot; records is equal 0 (m_ghostRecCnt = 0)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Also, Row - Offset table shows all three records, but you can notice that their offset remains as previous, before delete commnad is executed, what means that SQL Server didn&#39;t compacted page. About that, we speak some when next time.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; display: inline !important; float: none; font-family: &#39;Courier New&#39;; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</description><link>http://bypsoft.blogspot.com/2012/04/how-sql-server-deletes-records-delete.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibrF-NqPFlLQ3EKno9S7-VL3JKrQThJbkMCv8TQWDpSEsvoyq3B5LOIFbbHGC-pbCLetXCJgGgkfUInIXwQGG2yvdCRZyJkPEIdktJTrdmlBxeFh6aj5QRrzBqj6TY1yXX5Oag65bwVX8/s72-c/page.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-7003531691511879159</guid><pubDate>Fri, 20 Apr 2012 09:46:00 +0000</pubDate><atom:updated>2012-04-20T02:47:55.748-07:00</atom:updated><title>Disk I/O on SQL Server</title><description>To get a pending request longer than 10 milliseconds on your SQL Server&amp;nbsp; use&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: red;&quot;&gt;
SELECT * FROM [sys].[dm_io_pending_io_requests] WHERE [io_type] = &#39;disk&#39; AND [io_pending_ms_ticks] &amp;gt; 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</description><link>http://bypsoft.blogspot.com/2012/04/disk-io-on-sql-server.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-7660413525640130888</guid><pubDate>Sun, 02 May 2010 19:28:00 +0000</pubDate><atom:updated>2010-05-02T12:30:53.879-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">hide form</category><title>How to hide form on startup in .NET</title><description>&lt;div&gt;If you ever wanted to hide a form on startup  in a .NET  you  figured out that the task is not so obvious. If you just set Visible  property to False you will see that it will be ignored.&lt;/div&gt;&lt;div&gt;The  solution is to run the form as Minimized, by setting the form property  &lt;strong&gt;WindowState to minimized and in Form_Load function to set this.Visible =  false;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Please note that line&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;this.WindowState =  System.Windows.Forms.FormWindowState.Minimized;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;must be in  InitializeComponent()&lt;/strong&gt; function generated by designer. Either you add  this line manually there or set the WindowState property in the Form  designer. At the very end functions which hides your form on startup  looks like&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;private void  InitializeComponent()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;this.SuspendLayout();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;//&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;// Form1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;//&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;this.AutoScaleDimensions  = new System.Drawing.SizeF(6F, 13F);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;this.AutoScaleMode  = System.Windows.Forms.AutoScaleMode.Font;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;this.ClientSize  = new System.Drawing.Size(292, 266);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;this.ControlBox  = false;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;this.Name = &quot;Form1&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;this.Text =  &quot;Form1&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;this.WindowState =  System.Windows.Forms.FormWindowState.Minimized;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;this.Load +=  new System.EventHandler(this.Form1_Load);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;this.ResumeLayout(false);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;private  void Form1_Load(object sender, EventArgs e)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;{&lt;br /&gt;
&lt;strong&gt;this.Visible = false;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;</description><link>http://bypsoft.blogspot.com/2010/05/how-to-hide-form-on-startup-in-net.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-7969821902100326155</guid><pubDate>Sun, 28 Mar 2010 18:37:00 +0000</pubDate><atom:updated>2010-03-28T11:38:02.188-07:00</atom:updated><title>Database Full Text Search Tool</title><description>If you need to search for a particular word(s) or number(s) in a whole  database you can use &lt;a title=&quot;Full Text Search&quot; href=&quot;http://www.bypsoft.com/database_full_text_search.html&quot; target=&quot;_self&quot;&gt;DBTYP.NET  Database Full Text Search&lt;/a&gt; module which has been just added to the &lt;a title=&quot;Database Comparison Tool&quot; href=&quot;http://www.bypsoft.com/Compare_Databases.html&quot; target=&quot;_self&quot;&gt;DBTYP.NET Studio&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;img title=&quot;Database  Full Text Search Dialog&quot; src=&quot;http://www.bypsoft.com/img/FullTextSearchDlg.jpg&quot; alt=&quot;Database  Full Text Search&quot; width=&quot;369&quot; height=&quot;187&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
It performs searches on all data types except binary, xml and date/time values. So you are free to search for whole words, part of words using SQL LIKE wild-cards or even for the numbers.</description><link>http://bypsoft.blogspot.com/2010/03/database-full-text-search-tool.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-4664834130722866843</guid><pubDate>Fri, 26 Mar 2010 19:03:00 +0000</pubDate><atom:updated>2010-03-26T12:03:37.667-07:00</atom:updated><title>SQL Server Configuration Options</title><description>If you need to review configuration options of some SQL Server instance, you can get them out of the &lt;strong&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;SYS.CONFIGURATIONS&lt;/span&gt;&lt;/strong&gt; catalog view. So the select statement like&lt;br /&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;select * from sys.configurations&lt;/span&gt;&lt;/div&gt;&lt;div id=&quot;_mcePaste&quot; style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;order by name&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;will give you back all configuration options of SQL Server instance.</description><link>http://bypsoft.blogspot.com/2010/03/sql-server-configuration-options.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-2690159166830596380</guid><pubDate>Thu, 25 Mar 2010 21:20:00 +0000</pubDate><atom:updated>2010-03-25T14:20:52.971-07:00</atom:updated><title>Prevent Row Deletions/Updates on SQL Server</title><description>If you reach  a requirements to prevent some table for deletions or/and updates you  may wonder how to reach that. The simple answer is to use INSTEAD OF   triggers. INSTEAD OF triggers override the standard action of  triggering statement: INSERT,  UPDATE or DELETE. On that way, INSTEAD OF trigger can ignore parts of  the batch, not process part of the batch or taking an alternative  action. The major difference to the AFTER triggers is that INSTEAD OF  triggers can be defined on a views as well as on a tables.&lt;br /&gt;&lt;br /&gt;So, a solution of the problem, preventing a row deletions on the  table can be the following INSTEAD OF trigger:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #993366;&quot;&gt;CREATE TRIGGER trgPreventRowDeletion ON Test_table INSTEAD OF DELETE&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;REISEERROR (&#39;Deletions are not allowed from the Test_table&#39;, 16, 1)&lt;br /&gt;END &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On a similar way it can be defined INSTEAD  OF INSERT and INSTEAD OF UPDATE triggers.</description><link>http://bypsoft.blogspot.com/2010/03/prevent-row-deletionsupdates-on-sql.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-6935396490970649096</guid><pubDate>Thu, 25 Mar 2010 21:16:00 +0000</pubDate><atom:updated>2010-03-25T14:19:21.339-07:00</atom:updated><title>Identifying Index Fragmentation on SQL Server</title><description>The first thing you are doing when identifying poor query performances is to take a look at execution plan and indexes usage. Even that you see, everything is fine, your index can be fragmented so that SQL Server needs to make unnecessary data reads to execute query. At the end, your query is slow.&lt;br /&gt;At the moment when index is created, little or no fragmentation is present. During the time, when updates, inserts and deletes occur indexes get fragmented what is a real bottleneck in a SQL Server performances.&lt;br /&gt;&lt;br /&gt;There are two ways how to fix fragmented indexes: reorganizing or rebuilding them. Which operation is necessary depends on the level of fragmentation. Reorganization of index is suggested if fragmentation level is less than 30%. If it is more than 30% than rebuilding index is better choice.&lt;br /&gt;&lt;h3&gt;Identifying fragmented indexes&lt;/h3&gt;&lt;br /&gt;Starting from version 2005, SQL Server contains a number of DMVs and DMFs qhich allow us to retrieve informations  about SQL Server health and performances and identifying problems. One of them, allow us to take a look at the index fragmentation level - &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms188917.aspx&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;sys.dm_db_index_physical_stats&lt;/strong&gt;&lt;/a&gt; DMF. It is important to said here that it places intent shared lock (IS) on the affected tables during execution.&lt;br /&gt;&lt;p style=&quot;padding-left: 60px;&quot;&gt;&lt;span style=&quot;color: #800080;&quot;&gt;sys.dm_db_index_physical_stats (&lt;br /&gt;{ database_id | NULL | 0 | DEFAULT }&lt;br /&gt;, { object_id | NULL | 0 | DEFAULT }&lt;br /&gt;, { index_id | NULL | 0 | -1 | DEFAULT }&lt;br /&gt;, { partition_number | NULL | 0 | DEFAULT }&lt;br /&gt;, { mode | NULL | DEFAULT }&lt;br /&gt;)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;The following query will get fragmentation of all indexes in the database&lt;br /&gt;&lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;color: #800080;&quot;&gt;DECLARE @dbId int&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;color: #800080;&quot;&gt;SET @dbId = db_id(&#39;YOUR_DB_NAME&#39;) &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;color: #800080;&quot;&gt;SELECT s.[name] AS SchemaName, t.[name] AS TableName, i.[name] AS IndexName, p.[index_type_desc], p.[avg_fragmentation_in_percent]&lt;br /&gt;FROM [sys].[dm_db_index_physical_stats](@dbId, NULL, NULL, NULL , &#39;DETAILED&#39;) p&lt;br /&gt;INNER JOIN [sys].[tables] t  ON p.[object_id] = t.[object_id]&lt;br /&gt;INNER JOIN [sys].[schemas] s  ON t.[schema_id] = s.[schema_id]&lt;br /&gt;INNER JOIN [sys].[indexes] i  ON p.[object_id] = i.[object_id] AND p.index_id = i.index_id&lt;br /&gt;WHERE t.[is_ms_shipped] = 0&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;To get more proper candidates for rebuilding or reorganizing indexes it is necessary to consult other fields returned back from &lt;strong&gt;[sys].[dm_db_index_physical_stats]&lt;/strong&gt; like &lt;strong&gt;avg_page_space_used_in_percent&lt;/strong&gt; which indicates on average how full each page in index is. The higher number is better while but it is necessary here to balance fullness against the&lt;br /&gt;number of inserts into index pages in order to keep the number of page splits to the absolute minimum. This exceeds the topic of this blog and requires adjustments of index fillfactor and monitoring of page splits.</description><link>http://bypsoft.blogspot.com/2010/03/identifying-index-fragmentation-on-sql.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-2968231441117737004</guid><pubDate>Sun, 27 Sep 2009 19:30:00 +0000</pubDate><atom:updated>2009-09-27T12:30:21.956-07:00</atom:updated><title>ORA-01489: result of string concatenation is too long</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;One of&amp;nbsp; our customers reported us this error during reading stored procedures from Oracle database. What have caused this error? USER_SOURCE view retrieve name, type and line by line of function/stored procedure definition. Each line in a new row. We used hierarchical queries and sys_connect_by_path function to concatenate all of those lines in one which keeps the full function/stored procedure definition. &lt;/p&gt; &lt;p&gt;The problem is, that SQL in Oracle is able to return just 4000 bytes in one column. So, if any string is longer than 4000 bytes in concatenation you will get this error. And there is no possibility to fix it. You must change logic, use chunks or something similar (CLOBs). &lt;/p&gt; &lt;p&gt;As a small notice, T-SQL variables can be used for concatenation very big strings which exceeds 4000 characters. Again, you will not be able to return it back with SQL. &lt;/p&gt; &lt;p&gt;As a sample, the following code produces the error: &lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;&lt;font color=&quot;#ff8000&quot;&gt;select rpad(&#39; &#39;,4000)||&#39;1&#39; as 4001StringLength&lt;br&gt;from TestTable&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;pre&gt;but the following is fine:&lt;/pre&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;font color=&quot;#ff8000&quot;&gt;declare&lt;br&gt;testVar   varchar2(32767);&lt;br&gt;begin&lt;br&gt;testVar := rpad(&#39; &#39;,4000)||&#39;1&#39;&lt;br&gt;end;&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;  </description><link>http://bypsoft.blogspot.com/2009/09/ora-01489-result-of-string.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-7116402268338520920</guid><pubDate>Mon, 27 Apr 2009 19:58:00 +0000</pubDate><atom:updated>2009-06-20T04:57:54.289-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MySQL 5.4</category><category domain="http://www.blogger.com/atom/ns#">new features</category><title>MySQL 5.4</title><description>&lt;p&gt;New Features&lt;/p&gt;  &lt;p&gt;MySQL has released a new version of database server – MySQL in version 5.4. Latest release was 5.1 with a really great features. This one brings not so much but also very important features:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;InnoDB storage engine can address more than 4 CPU’s/cores. Thjs helps that MySQL scale much better under huge application workloads. &lt;/li&gt;    &lt;li&gt;Till now, subqueries were well known as performance problematical. In version 5.4 subquery optimization has been improved a lot in a number of various use cases. As MySQL mentioned in the example below, execution time dropped from 12 minutes (9 000 000 reads) on MySQL 5.1 to just 1.8 seconds (153 000 reads) on MySQL 5.4&lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;pre&gt;SELECT COUNT(l_orderkey) FROM lineitem&lt;br /&gt;WHERE l_linenumber=1 AND&lt;br /&gt;      l_orderkey IN&lt;br /&gt;      (SELECT o_orderkey FROM orders&lt;br /&gt;         WHERE o_totalprice &amp;gt; 1000 AND&lt;br /&gt;               o_custkey IN&lt;br /&gt;               (SELECT c_custkey FROM customer&lt;br /&gt;                  WHERE c_address LIKE &#39;Le%&#39;));&lt;br /&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;MySQL 5.4 offers a new much better join algorithm which speed up execution time of multi-way joins like in the following example &lt;/li&gt;  &lt;/ul&gt;  &lt;pre&gt;SELECT COUNT(*) FROM part, lineitem&lt;br /&gt;       WHERE l_partkey=p_partkey AND p_retailprice&amp;gt;2050&lt;br /&gt;             AND l_discount&amp;gt;0.04;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;Improved error handling – through the implementation of standard SQL (SQL 2003) SIGNAL and RESIGNAL operations  in stored procedures, functions and triggers developers are able to signal rule violations during execution. &lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;p&gt;Must mention here that Oracle and SQL Server not implement this functionality but have their own mechanisms: Oracle through RAISE  and SQL Server through RAISEERROR statements.&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;INFORMATION_SCHEMA got a new objects PARAMETERS. We wait a lot on this. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;In prior version of MySQL out parameter were not possible in prepared statements. That has been changed now.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;p&gt;This is all from programmers perspective. Have a fun.&lt;br /&gt;&lt;/p&gt;&lt;pre id=&quot;line1&quot;&gt;&lt;a href=&quot;http://www.bypsoft.com/Compare_Databases.html&quot;&gt;&lt;span class=&quot;attribute-value&quot;&gt;Compare SQL Server, Oracle and MySQL database with DBTYP.NET Studio&lt;/span&gt;&lt;/a&gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://bypsoft.blogspot.com/2009/04/mysql-54.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-706888574477827097</guid><pubDate>Thu, 19 Mar 2009 20:38:00 +0000</pubDate><atom:updated>2009-06-20T05:01:39.758-07:00</atom:updated><title>Table &amp;#39;mysql.proc&amp;#39; doesn&amp;#39;t exist.</title><description>&lt;p&gt;Sometimes our support team receive a helpdesk request concerning this error message shown in Schema Comparison of DBTYP.NET 2009 Studio. &lt;/p&gt;  &lt;p&gt;The usual problem with such a customers is that almost all of them make recent upgrade of MySQL server.  While some releases of MySQL introduce changes in the structure of the system tables in mysql database to add new privileges and support new features, it is necessary to update the system tables as well. &lt;/p&gt;  &lt;p&gt;This can be achieved by running &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/mysql-fix-privilege-tables.html&quot;&gt;&lt;strong&gt;mysql_fix_privilege_tables&lt;/strong&gt;&lt;/a&gt; script in MySQL prior to version 5.1.7 or &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/mysql-upgrade.html&quot;&gt;&lt;strong&gt;mysql_upgrade&lt;/strong&gt;&lt;/a&gt; in version 5.1.7 or above. &lt;/p&gt;  &lt;p&gt;For more details check following links:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a title=&quot;http://dev.mysql.com/doc/refman/5.1/en/mysql-fix-privilege-tables.html&quot; href=&quot;http://dev.mysql.com/doc/refman/5.1/en/mysql-fix-privilege-tables.html&quot;&gt;http://dev.mysql.com/doc/refman/5.1/en/mysql-fix-privilege-tables.html&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title=&quot;http://dev.mysql.com/doc/refman/5.1/en/mysql-upgrade.html&quot; href=&quot;http://dev.mysql.com/doc/refman/5.1/en/mysql-upgrade.html&quot;&gt;http://dev.mysql.com/doc/refman/5.1/en/mysql-upgrade.html&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;a href=&quot;http://www.bypsoft.com/Compare_Databases.html&quot;&gt;See all database differences and dependencies with DBTYP.NET Studio&lt;/a&gt;</description><link>http://bypsoft.blogspot.com/2009/03/table-doesn-exist.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-4986392575442730425</guid><pubDate>Fri, 04 Jul 2008 20:12:00 +0000</pubDate><atom:updated>2008-07-04T13:17:00.142-07:00</atom:updated><title>DBTyP.NET 2008 Release 3 Available</title><description>BYPsoft announced the availability of DBTyP.NET 2008 Release 3, the newest version of the cross-database comparison tool that compares SQL Server, MySQL and Oracle databases (schema and data). DBTyP.NET 2008 Release 3 is available for download from &lt;a href=&quot;http://www.bypsoft.com/&quot;&gt;http://www.bypsoft.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;With its rich support for schema and data cross-database comparison, DBTyP.NET takes the mystery out of databases, making their comparison practical and easy for programmers and database administrators everywhere. Over and above its powerful comparison capabilities till now, BYPsoft added to the DBTyP.NET 2008 support for schema comparisons for Oracle databases. Full cross database comparison family includes now support for SQL Server, MySQL and Oracle databases in the latest release of DBTyP.NET 2008 for a fraction of the cost of single-database solution.&lt;br /&gt;&lt;br /&gt;Since the DBTyP.NET is under constant development, user interface has been redesigned and rich visual interface and easy-to-use features of DBTyP.NET 2008 allow developers and DBAs to  identify and deploy changes quickly on all supported databases and enhance productivity and maximize results. Features like colorfull differences, different objects icons, visual column description, in place colorfull script differences, multiple views and more all save time and ensure accuracy.&lt;br /&gt;&lt;br /&gt;In addition to all the new features listed above, in the latest release of DBTyP.NET 2008 BYPsoft includes also the following:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SQL Server 2008 Ready&lt;/li&gt;&lt;li&gt;Support for SQL Server ROWGUIDCOL&lt;/li&gt;&lt;li&gt;Filtered out system objects on SQL Server databases.&lt;/li&gt;&lt;li&gt;Support SQLServer user defined types.&lt;/li&gt;&lt;li&gt;Support MySQL ENUM and SET data types.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;We know that constant development is the key to progress, therefore we already started working on all new cool features. Stay with us.</description><link>http://bypsoft.blogspot.com/2008/07/dbtypnet-2008-release-3-available.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-1124874059383772481</guid><pubDate>Mon, 12 May 2008 12:30:00 +0000</pubDate><atom:updated>2009-06-20T05:00:11.121-07:00</atom:updated><title>List All Functions and Stored Procedures definitions in Oracle schema</title><description>A long time I have not published anything. &lt;a href=&quot;http://www.bypsoft.com/&quot;&gt;BYPsoft&lt;/a&gt; preparing new version of &lt;a href=&quot;http://www.bypsoft.com/dbtyp.html&quot;&gt;DBTyP.NET&lt;/a&gt; with full support for a &lt;a href=&quot;http://www.bypsoft.com/dbtyp.html&quot;&gt;Oracle schema comparison&lt;/a&gt; and therefore didn&#39;t had any free time left for this blog.&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;A very interesting topic came to me out of this experience. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;Have you ever tried to get a list of all stored procedures and functions in Oracle schema? Preaty easy, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);font-family:verdana;&quot; &gt;SELECT * FROM USER_PROCEDURES;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;You figured out that it is quite different comparing to SQL Server and MySQL where with the single query &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;SELECT *  FROM INFORMATION_SCHEMA.ROUTINES;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;you get a body definition as well. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;To achieve this on Oracle is not so simply. First, to get user sources you should query &lt;span style=&quot;color: rgb(255, 153, 102); font-style: italic;&quot;&gt;USER_SOURCE&lt;/span&gt; view where each function or stored procedure line is stored in one row. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;To get a full body, you have to use a powerful hierarchical query clause &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;color: rgb(255, 153, 102); font-style: italic;&quot;&gt;SYS_CONNECT_BY_PATH&lt;/span&gt;. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;Here is a query which returns you list of all stored procedures and functions in Oracle schema together with their bodies defined in one column:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;SELECT routine_name, y.TYPE, TRANSLATE(LTRIM(x.text1, &#39;/&#39;), &#39;/&#39;, &#39; &#39;) routine_definition  &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;FROM (SELECT name routine_name, LEVEL lvl,  sys_connect_by_path(text, &#39;/&#39;) text1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;                   FROM USER_SOURCE&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;                   CONNECT BY LINE - 1  = PRIOR LINE AND name = PRIOR name) x,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;                   (SELECT name, TYPE, MAX(line) AS maxline&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;                    FROM USER_SOURCE&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;                   GROUP BY name, TYPE) y               &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;WHERE x.routine_name = y.name AND x.lvl = y.maxline&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;ORDER BY TYPE, routine_name&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.bypsoft.com/Compare_Databases.html&quot;&gt;Compare database schema and data fast and easy with DBTYP.NET Studio&lt;/a&gt;&lt;br /&gt;&lt;/code&gt;</description><link>http://bypsoft.blogspot.com/2008/05/list-all-functions-and-stored.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-2453123883221334889</guid><pubDate>Sat, 01 Mar 2008 23:29:00 +0000</pubDate><atom:updated>2008-03-01T15:54:37.356-08:00</atom:updated><title>MySqlDateTime and .NET</title><description>In version 2008 our cross database comparison tool &lt;a href=&quot;http://www.bypsoft.com/dbtyp.html&quot;&gt;DBTyP.NET&lt;/a&gt; will  support cross  data comparison  between  SQL Server  and MySQL DateTime values (date, datetime, smalldatetime). Actually, this is a common problem, between MySql.Data.Types.MySqlDateTime and System.DateTime types in .NET. It is very possible that if you tries to update MySqlDateTime column with DateTime variable you will get SystemArgumentException saying that could not store value ... into ... Expected type is MySqlDateTime. It is possible to format value as &quot;yyyy-MM-dd HH:mm:ss&quot; but in our case we don&#39;t want to iterate through whole DataSet and make this formatting.&lt;br /&gt;Very elegant solution is to change a DataColumn type from MySqlDateTime to System.DateTime as&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;myMySqlDateTimeColum.DataType = typeof(System.DateTime);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After that you should not worry about formatting.</description><link>http://bypsoft.blogspot.com/2008/03/mysqldatetime-and-net.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-8550241637775586725</guid><pubDate>Fri, 29 Feb 2008 23:26:00 +0000</pubDate><atom:updated>2008-02-29T15:42:33.117-08:00</atom:updated><title>How to check if class has been used in Web or Windows application</title><description>After a while, I decided to participate in a newsgroups tonight and found an interesting question. &quot;Is there a programmatic way for the class lib to determine what kind of app is running - web or windows&quot;. The worst, guy requested official response from Microsoft support and didn&#39;t get an answer. After 3 days his question wasn&#39;t answered, he re-posted it. So, is there are something wrong? Looks like not.&lt;br /&gt;The simple answer from my side was, to implement following function somewhere in his shared assembly:&lt;br /&gt;&lt;span style=&quot;color:#ffcc33;&quot;&gt;public bool IsWebApp(){&lt;br /&gt;return (HttpContext.Current != null);&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;So, if there is Current HttpContext than function has been called from ASP.NET application and if there is not such an object, function is called from Windows Forms application.&lt;br /&gt;Simple enough.</description><link>http://bypsoft.blogspot.com/2008/02/how-to-check-if-class-has-been-used-in.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-1904641785780078928</guid><pubDate>Tue, 26 Feb 2008 21:51:00 +0000</pubDate><atom:updated>2009-03-19T13:53:43.565-07:00</atom:updated><title>Handling Miliseconds in .NET and SQL Server</title><description>Have you taken a look at number of such a questions in online community? It looks like that a lot of .NET developers have a problems reading and updating milliseconds value from SQL Server databases. So what is a real problem here?  &lt;br /&gt;Let&#39;s take a look at common scenario. Developers read data from a table which has Datetime column ColDateTime. Let&#39;s say they are storing values in some DataTable table1. Suddenly, if you want just to print a Value of that field, with  &lt;br /&gt;  &lt;br /&gt;&lt;span style=&quot;color: rgb(204,0,0)&quot;&gt;table1.Rows[0].Cells[&amp;quot;ColDateTime&amp;quot;].Value.ToString()   &lt;br /&gt;    &lt;br /&gt;&lt;/span&gt;you will get value like &#39;2008/02/26 2:26:53 PM&#39;. But you value in database is actually &#39;2008/02/26 14:26:53.3480&#39;. So milliseconds are missing. The only way to get them is to convert value from database in DateTime variable and then print out that variable:  &lt;br /&gt;  &lt;br /&gt;&lt;span style=&quot;color: rgb(204,0,0)&quot;&gt;DateTime dtDbValue = System.Covert.ToDateTime(table1.Rows[0].Cells[&amp;quot;ColDateTime&amp;quot;]);   &lt;br /&gt;dtDbValue.ToString();&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;Now, you have a real value: &#39;2008/02/26 14:26:53.3480&#39;  &lt;br /&gt;  &lt;br /&gt;Connected to this is also reverse process, where people lose milliseconds during update. Take a look at following statements:  &lt;br /&gt;  &lt;br /&gt;&lt;span style=&quot;color: rgb(204,0,0)&quot;&gt;DateTame dtValue = DateTime.Now;&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;span style=&quot;color: rgb(204,0,0)&quot;&gt;string sql = &amp;quot;update table1 set ColDateTime = &#39;&amp;quot; + dtValue.ToString() + &amp;quot;&#39;&amp;quot;;&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;-- create DataCommand, assign CommandText and execute.  &lt;br /&gt;  &lt;br /&gt;You will see that your column has been updated with the wrong value. Again milliseconds cut.  &lt;br /&gt;  &lt;br /&gt;People try very often to format ToString method call to looks like:  &lt;br /&gt;&lt;span style=&quot;color: rgb(204,0,0)&quot;&gt;string sql = &amp;quot;update table1 set ColDateTime = &#39;&amp;quot; + dtValue.ToString(&amp;quot;yyyy/MM/dd hh:mm:ss.ffff&amp;quot;) + &amp;quot;&#39;&amp;quot;;&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;but this cause an exception on SQL Server side saying that varchar value can not be converted to Datetime type. Strange, and maybe lack of documentation, but the solution is to format your DateTime value with different format - using 3 f and not 4:  &lt;br /&gt;  &lt;br /&gt;&lt;span style=&quot;color: rgb(204,0,0)&quot;&gt;string sql = &amp;quot;update table1 set ColDateTime = &#39;&amp;quot; + dtValue.ToString(&amp;quot;yyyy/MM/dd hh:mm:ss.fff&amp;quot;) + &amp;quot;&#39;&amp;quot;;&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;a id=&quot;kj4p&quot; title=&quot;Compare database&quot; href=&quot;http://www.bypsoft.com/&quot;&gt;Compare databases&lt;/a&gt; fast, safe, free... DBTyP.NET - in version 2008 supports Oracle besides SQL Server and MySQL. DBTyP.NET 2008 is coming... in 3 weeks.    </description><link>http://bypsoft.blogspot.com/2008/02/handling-miliseconds-in-net-and-sql.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-5744729517624410025</guid><pubDate>Sat, 02 Feb 2008 22:51:00 +0000</pubDate><atom:updated>2008-03-07T13:36:20.855-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">help authoring tool</category><title>Great Help Authoring Tool</title><description>We have just discovered and get impressed with &lt;a href=&quot;http://www.roledata.com/rolehelp.htm&quot;&gt;Rolehelp&lt;/a&gt;. We are still testing different help authoring tools but this one with their simplicity, great user interface, feature reach capabilities and creation of 7 different help formats simply fascinate us. Of course, we have never wanted to spend 1000$ for such a tool, therefore Roledata offer of 59$ and free demo version with limitation of 50 topics is very, very attractive one. So, if you need fast, simple, free or at least cheap help authoring tool, visit them and you will get one great tool.&lt;br /&gt;I&#39;m sure we will use it in our data and schema compare solution in version 2008.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.bypsoft.com/dbtyp.html&quot;&gt;Synchronize and compare the structure and data of your SQL Server, Oracle, and MySQL databases - DBTyP.NET by BYPsoft&lt;/a&gt;</description><link>http://bypsoft.blogspot.com/2008/02/great-help-authoring-tool.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-8922165809796298138</guid><pubDate>Tue, 29 Jan 2008 08:56:00 +0000</pubDate><atom:updated>2008-01-29T01:03:00.930-08:00</atom:updated><title>MSDN Launches Code Galery</title><description>We found very interesting and wanted to share it with all of you that MSDN launches yesterday &lt;a href=&quot;http://code.msdn.microsoft.com/&quot;&gt;Code Gallery&lt;/a&gt; dedicated to developers community for sharing samples, tools, articles, participating in discussions... &lt;br /&gt;Code Gallery has been used till now by internal Microsoft employess for sharing code samples and tools and now is availalble to the community. Anyone with LIVE ID can post there. Let&#39;s see how this will work.</description><link>http://bypsoft.blogspot.com/2008/01/msdn-launches-code-galery.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-2218859926074965275</guid><pubDate>Sun, 27 Jan 2008 21:12:00 +0000</pubDate><atom:updated>2008-01-27T13:23:24.539-08:00</atom:updated><title>Primary keys without &quot;real&quot; tables</title><description>Have you queried some when information_schema.table_constraints or sys.key_constraints to discover a primary keys in your database? And as a result from &lt;span style=&quot;font-style:italic;&quot;&gt;select * from information_schema.table_constraints&lt;/span&gt; you noticed that there are primary keys without TABLE_SCHEMA and TABLE_NAME in resultset? &lt;br /&gt;You can be confused with this but the explanation is simple. Your primary keys defined in table-valued functions have been listed here. So if you have a function defined as &lt;br /&gt;&lt;br /&gt;CREATE FUNCTION [dbo].[fnTest]&lt;br /&gt;  (&lt;br /&gt;   @foo int&lt;br /&gt;  )&lt;br /&gt;returns @resultTable table (test1 int, test2 int primary key (test1))&lt;br /&gt;as&lt;br /&gt;begin&lt;br /&gt; insert into @resultTable(test1, test2)&lt;br /&gt; select 1, @foo&lt;br /&gt;&lt;br /&gt; return&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;you will have as CONSTRAINT_NAME something like &quot;PK__fnTest__2D27B809&quot; and TABLE_SCHEMA and TABLE_NAME will be NULL.</description><link>http://bypsoft.blogspot.com/2008/01/primary-keys-without-real-tables.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-5904837770229024640</guid><pubDate>Fri, 23 Nov 2007 21:31:00 +0000</pubDate><atom:updated>2009-06-20T05:10:04.576-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET 2.0</category><category domain="http://www.blogger.com/atom/ns#">.NET3.5</category><category domain="http://www.blogger.com/atom/ns#">Automatic Properties</category><category domain="http://www.blogger.com/atom/ns#">Visual Studio 2008</category><title>Visual Studio 2008 - Automatic Properties in .NET 2.0</title><description>In the next couple of blogs we will present shortly some cool and interesting stuff we found about Visual Studio 2008 and .NET Framework 3.5. For all cool stuff see &lt;a href=&quot;http://msdn2.microsoft.com/en-us/vstudio/default.aspx&quot;&gt;Visual Studio 2008 Official page.&lt;/a&gt;&lt;br /&gt;One of the first items we noticed and played around are Automatic Properties. What does it mean? Untill now it was common to define a class as&lt;br /&gt;   public class Test&lt;br /&gt;   {&lt;br /&gt;       public Test() { }&lt;br /&gt;      &lt;br /&gt;       private string _firstName;&lt;br /&gt;       public string FirstName&lt;br /&gt;       {&lt;br /&gt;           get { return _firstName; }&lt;br /&gt;           set { _firstName = value; }&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;where for each property you usually had a private member variable.&lt;br /&gt;But now, Visual Studio 2008 and .NET framework 3.5 introduces Automatic Proeprties where your class can be defined as&lt;br /&gt;&lt;br /&gt;public class Test&lt;br /&gt;   {&lt;br /&gt;       public Test() { }&lt;br /&gt;       public string FirstName { get; set; }&lt;br /&gt;   }&lt;br /&gt;and you will notice that a private member variable is missing and a whole body of the property implementation itself (it has just a stub definition get; set; )&lt;br /&gt;Imagine how much you reduce a time for class scripting. Readability is also much better.&lt;br /&gt;But you will probably ask, where does .NET keep your data now? If you take a look at IL you will find that actually a compiler generates a field (variable) for you:&lt;br /&gt;&#39;&lt;&gt;k__AutomaticallyGeneratedPropertyField0&#39;. Whole construction is done just by using CompilerGeneratedAttribute. But, what we had in mind, this attribute is part of .NET Framework 2.0, what lead us to... Hey, Automatic Properties are possible in .NET 2.0 than?! And this is really true. Open your Visual Studio 2008 (Express), create such a construction, as a Target Framework for a project choose .NET Framework 2.0 and you will see it runs.  WOW!!! We like this very much and will use it in &lt;a href=&quot;http://www.bypsoft.com/Compare_Databases.html&quot;&gt;DBTyP.NET&lt;/a&gt; as soon as possible.</description><link>http://bypsoft.blogspot.com/2007/11/visual-studio-2008-automatic-properties.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-5296718321272593155</guid><pubDate>Tue, 13 Nov 2007 06:59:00 +0000</pubDate><atom:updated>2009-06-20T05:09:18.189-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">cross site scripting</category><category domain="http://www.blogger.com/atom/ns#">Formatting Date</category><title>Formatting bounded DateTime fields in ASP.NET</title><description>&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;If you ever tried to work with BoundField object bound to a DateTime field with the DataFormatString, it must happen, that first time you didn&#39;t get your DateTime value proeprly formatted. &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:&amp;quot;;font-size:11;color:lightblue;&quot;   &gt;&lt;&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:11;color:maroon;&quot;   &gt;asp&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:11;color:lightblue;&quot;   &gt;:&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:11;color:maroon;&quot;   &gt;BoundField&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:11;&quot;  &gt;&lt;span style=&quot;font-style: italic;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-style: italic;color:red;&quot; &gt;DataField&lt;/span&gt;&lt;span style=&quot;font-style: italic;color:lightblue;&quot; &gt;=&quot;MyNotFormattedDate&quot;&lt;/span&gt; &lt;span style=&quot;font-style: italic;color:red;&quot; &gt;DataFormatString&lt;/span&gt;&lt;span style=&quot;font-style: italic;color:lightblue;&quot; &gt;=&quot;{0:MM/dd/yyyy}&quot;&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:lightblue;&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;style=&quot;color:white;&quot;&quot;&gt;Looks like that you have done everything correct but still getting your value formatted using its ToString() method like &quot;11/13/2007 10:05:12 PM&quot;. So, the problem is not in your definition but in ASP.NET which tries to prevent cross site scripting attacks, the field value is HTMLEncoded. And HTMLEncoding occurs before applying any formatting, making your formatting string without effects. To Get your field formatted as you define, you should tell object not to use HTMLEncoding like &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:11;color:lightblue;&quot;   &gt;&lt;&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:11;color:maroon;&quot;   &gt;asp&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:11;color:lightblue;&quot;   &gt;:&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:11;color:maroon;&quot;   &gt;BoundField&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:11;&quot;  &gt; &lt;span style=&quot;color:red;&quot;&gt;DataField&lt;/span&gt;&lt;span style=&quot;color:lightblue;&quot;&gt;=&quot;MyFormattedDate&quot;&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;DataFormatString&lt;/span&gt;&lt;span style=&quot;color:lightblue;&quot;&gt;=&quot;{0:MM/dd/yyyy}&quot;&lt;/span&gt;  &lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:11;color:red;&quot;   &gt;HtmlEncode&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:11;color:lightblue;&quot;   &gt;&lt;span style=&quot;font-style: italic;&quot;&gt;=&quot;false&quot;/&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.bypsoft.com/Compare_Databases.html&quot;&gt;Compare databases with the best tool - DBTYP.NET Studio.&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://bypsoft.blogspot.com/2007/11/formatting-bounded-datetime-fields-in.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-8135143393092484903</guid><pubDate>Tue, 30 Oct 2007 21:05:00 +0000</pubDate><atom:updated>2009-06-20T05:08:15.375-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">default column values</category><category domain="http://www.blogger.com/atom/ns#">default constraints</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><title>Changing default column values - SQL Server</title><description>&lt;span style=&quot;font-family:verdana;&quot;&gt;A very common mistake in T-SQL  is trying to alter column definition trying to alter DEFAULT value (constraint) for that column. Probably, developers expect to have this because it is possible to assign default value for a column &lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;during table definition&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;:&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(255, 153, 0);&quot;&gt;CREATE TABLE Table1 (&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(255, 153, 0);&quot;&gt;    col1 INT NOT NULL DEFAULT (0),&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(255, 153, 0);&quot;&gt;    col2 INT NOT NULL&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(255, 153, 0);&quot;&gt;)&lt;/span&gt;&lt;br /&gt;Due to possibility to change column type from int to varchar(20) or null-ability with&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(255, 153, 0);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(255, 153, 0);&quot;&gt;ALTER TABLE&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(255, 153, 0);&quot;&gt; Table1 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(255, 153, 0);&quot;&gt;ALTER COLUMN&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(255, 153, 0);&quot;&gt; col2 VARCHAR(20) NULL&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;a lot of developers expect to be able to change a column default value with&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(255, 153, 0);&quot;&gt;ALTER TABLE Table1 ALTER COLUMN col1 DEFAULT (1)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;Error message is displayed trying to execute this: &lt;span style=&quot;font-style: italic;&quot;&gt;&quot;Incorrect syntax near the keyword &#39;DEFAULT&#39;&quot;.&lt;br /&gt;Mistake.&lt;br /&gt;&lt;/span&gt;With a create table syntax mentioned earlier, &lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;SQL Server&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt; creates default constraint with auto generated name like&lt;span style=&quot;font-style: italic;&quot;&gt; &quot;DF__Table1__col1__57DD0BE4&quot; &lt;/span&gt;and stores default value in&lt;span style=&quot;font-style: italic;&quot;&gt; [text] &lt;/span&gt;column of&lt;span style=&quot;font-style: italic;&quot;&gt; syscomments &lt;/span&gt;table&lt;span style=&quot;font-style: italic;&quot;&gt;.&lt;br /&gt;&lt;/span&gt;So, to change a default value for a column you should change a constraint definition&lt;span style=&quot;font-style: italic;&quot;&gt; &lt;/span&gt;and the only way to do that is to drop current constraint and create the new one:&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;ALTER TABLE table1 DROP CONSTRAINT &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 153, 0);font-family:verdana;&quot; &gt;&lt;span style=&quot;font-style: italic;&quot;&gt;DF__Table1__col1__57DD0BE4&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;ALTER TABLE table1 WITH NOCHECK ADD CONSTRAINT [Df_test_col1] DEFAULT (1) FOR col1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.bypsoft.com/Compare_Databases.html&quot;&gt;Compare databases with the fastest tool - DBTYP.NET&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://bypsoft.blogspot.com/2007/10/changing-default-column-values-sql.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-1369841089306824011</guid><pubDate>Wed, 24 Oct 2007 19:10:00 +0000</pubDate><atom:updated>2008-12-13T23:07:03.797-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.net</category><category domain="http://www.blogger.com/atom/ns#">check box</category><category domain="http://www.blogger.com/atom/ns#">datagridview</category><title>CheckBox header column for DatagridView</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVBzL2b5IXJCoaQbXXMZgWYYOUifou7M_CZzhi62QcSocK16RjxFGdCHR6S_JWzLLPmWYCOuIsP5lvujKvx71z60TJNhIKUY5B1uqa_IFO2ZRBdDas-RXZKSnemxKPZofDwxNrBn2njDM/s1600-h/CheckBoxHeader.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVBzL2b5IXJCoaQbXXMZgWYYOUifou7M_CZzhi62QcSocK16RjxFGdCHR6S_JWzLLPmWYCOuIsP5lvujKvx71z60TJNhIKUY5B1uqa_IFO2ZRBdDas-RXZKSnemxKPZofDwxNrBn2njDM/s320/CheckBoxHeader.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5124984003525214690&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span name=&quot;intelliTxt&quot; id=&quot;intelliTXT&quot;&gt;It is very common to have a list of items in &lt;span style=&quot;font-style: italic;&quot;&gt;DataGridView&lt;/span&gt; with a check box in the first column where your later action will depend on user selection. This can be very easy done having a first column defined as &lt;span style=&quot;font-style: italic;&quot;&gt;DataGridViewCheckBoxCell&lt;/span&gt; object. But, how can your customer select all items in the list (let&#39;s say you are working on an email client app and user wants to delete all of his 100 spams)?&lt;br /&gt;Unfortunately, .NET framework does not have a header class similar to &lt;span style=&quot;font-style: italic;&quot;&gt;DataGridViewCheckBoxColumn&lt;/span&gt;. Such a problem lead us to the idea to generate a class which will have a check box item in header where developer can have a full control after user check/uncheck item in the header. Common action is to check/uncheck all items in the DataGridView depending if header is checked/unchecked.&lt;br /&gt;Whole article and class definition is available at &lt;a href=&quot;http://www.codeproject.com/cs/miscctrl/CheckBoxHeaderCell.asp&quot;&gt;http://www.codeproject.com/useritems/CheckBoxHeaderCell.asp&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://bypsoft.blogspot.com/2007/10/checkbox-header-column-for-datagridview.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVBzL2b5IXJCoaQbXXMZgWYYOUifou7M_CZzhi62QcSocK16RjxFGdCHR6S_JWzLLPmWYCOuIsP5lvujKvx71z60TJNhIKUY5B1uqa_IFO2ZRBdDas-RXZKSnemxKPZofDwxNrBn2njDM/s72-c/CheckBoxHeader.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4318562544068519860.post-2682432175019635060</guid><pubDate>Wed, 24 Oct 2007 11:36:00 +0000</pubDate><atom:updated>2007-10-24T04:45:20.838-07:00</atom:updated><title>Introduction</title><description>&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;BYPsoft decided to be a part of programming community and brings a valuable expirence to others. You can find our posts in different forums all around the world. But now, it is time to collect all of this, and brings new and interesting topics, mainly from .NET area to publicity.  Besides writing on .NET stuff we will also promote our &lt;a href=&quot;http://www.bypsoft.com&quot;&gt;database comparison tool&lt;/a&gt; &lt;a href=&quot;http://www.bypsoft.com&quot;&gt;DBTyP.NET&lt;/a&gt;  here.</description><link>http://bypsoft.blogspot.com/2007/10/introduction.html</link><author>noreply@blogger.com (DLM@BYPsoft)</author><thr:total>0</thr:total></item></channel></rss>