<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-AU">
  <id>https://david.gardiner.net.au/tags/SQL%20Server.xml</id>
  <title type="html">David Gardiner - SQL Server</title>
  <updated>2026-05-23T00:34:35.149Z</updated>
  <subtitle>Blog posts tagged with &apos;SQL Server&apos; - A blog of software development, .NET and other interesting things</subtitle>
  <rights>Copyright 2026 David Gardiner</rights>
  <icon>https://www.gravatar.com/avatar/37edf2567185071646d62ba28b868fab?s=64</icon>
  <logo>https://www.gravatar.com/avatar/37edf2567185071646d62ba28b868fab?s=256</logo>
  <generator uri="https://github.com/flcdrg/astrojs-atom" version="3">astrojs-atom</generator>
  <author>
    <name>David Gardiner</name>
  </author>
  <link href="https://david.gardiner.net.au/tags/SQL%20Server.xml" rel="self" type="application/atom+xml"/>
  <link href="https://david.gardiner.net.au/tags/SQL%20Server" rel="alternate" type="text/html" hreflang="en-AU"/>
  <category term="SQL Server"/>
  <category term="Software Development"/>
  <entry>
    <id>https://david.gardiner.net.au/2006/04/data-constraints-in-multi-tier</id>
    <updated>2006-04-19T08:42:00.000+09:30</updated>
    <title>Data constraints in a multi-tier application</title>
    <link href="https://david.gardiner.net.au/2006/04/data-constraints-in-multi-tier" rel="alternate" type="text/html" title="Data constraints in a multi-tier application"/>
    <category term="SQL Server"/>
    <published>2006-04-19T08:42:00.000+09:30</published>
    <summary type="html">I&apos;m wondering about what are the best practises, particularly in a .NET world for this kind of scenario, which must be pretty common.</summary>
    <content type="html">&lt;p&gt;I&apos;m wondering about what are the best practises, particularly in a .NET world for this kind of scenario, which must be pretty common. My goals are to a) have decent performance and b) have as few instances of separate (but identical) constant values as possible. Here&apos;s the scenario:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You have a database with some tables, and say a table has a varchar column with a maximum length of 255 characters. All good so far! (Constant count = 1)&lt;/li&gt;
&lt;li&gt;You then create a .NET 2.0 DataSet with TableAdapters for that table, so now the DataSet also knows that the column has a MaxLength of 255. (Constant count = 2)&lt;/li&gt;
&lt;li&gt;You now create a business object which has a property which also maps to the same column (and would be persisted by passing it back through the DataSet/TableAdapter from step 2). You add checks to this property to ensure it also never gets larger than the maximum length allowed. (Constant count = 3)&lt;/li&gt;
&lt;li&gt;You create a web form (or a Windows Forms for that matter) that has a text field for the user to edit the same column. You set the maxlength attribute of that text field so the browser restricts the user to the size limit for that field. You also add a server-side validator to validate the text field and enforce that size limit (just in case their web browser ignores the maxlength attribute). (Constant count = 4)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We&apos;ve managed to embed the value &apos;255&apos; at least 4 times in our application! While that may not bother some people, it it does annoy me. The concept of having a single constant that represents a value and allows you to easily change the value in one place should you need to is something I&apos;ve adopted for a long time.&lt;/p&gt;
&lt;p&gt;So how can we reduce this down?&lt;/p&gt;
&lt;p&gt;Assuming that we&apos;re going to stick with a normal relational database and keep the limit for the column there, then that&apos;s one instance we can&apos;t remove.&lt;/p&gt;
&lt;p&gt;It is true that we could use database queries to retrieve that value and use it all over our app, but I&apos;m pretty sure the performance for that would not be ideal, and it does mean that some potential compile-time checks might be missed.&lt;/p&gt;
&lt;p&gt;If you assume that your UI tier only talks to the business layer, and the business layer is the only thing that talks to the data layer, what is the best way to percolate through these kind of values with as few separate constants as possible? If I change the length of the column in the database, I want to change as few constants in my code as possible, so that there&apos;s less chance I miss one and cause a problem with the application.&lt;/p&gt;
&lt;p&gt;I&apos;d be interested in other people&apos;s thoughts, or if anyone has links to content that covers this topic.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2006/04/hey-thats-me</id>
    <updated>2006-04-14T20:24:00.000+09:30</updated>
    <title>&quot;Hey, that&apos;s me!&quot;</title>
    <link href="https://david.gardiner.net.au/2006/04/hey-thats-me" rel="alternate" type="text/html" title="&quot;Hey, that&apos;s me!&quot;"/>
    <category term="Adelaide"/>
    <category term="Blogging"/>
    <category term="Mozilla"/>
    <category term="SQL Server"/>
    <published>2006-04-14T20:24:00.000+09:30</published>
    <summary type="html">I just noticed there&apos;s a link to my blog on the Australian SQL Server User Group home page - I&apos;m not sure how long it&apos;s been there, but then I don&apos;t always look up in the top-right corner :-)</summary>
    <content type="html">&lt;p&gt;I just noticed there&apos;s a link to my blog on the &lt;a href=&quot;http://www.sqlserver.com.au/&quot;&gt;Australian SQL Server User Group&lt;/a&gt; home page - I&apos;m not sure how long it&apos;s been there, but then I don&apos;t always look up in the top-right corner :-)&lt;/p&gt;
&lt;p&gt;Which reminds me, when I have some spare time I need to see if I can fix the layout problem with their Forums area in Firefox. I also put my hand up to add some RSS feeds to the site which I haven&apos;t done anything about yet.&lt;/p&gt;
&lt;p&gt;Returning to a positive note however, I&apos;m pleased to see that the Adelaide SQL group is doing really well at the moment. Maybe it&apos;s our &lt;a href=&quot;http://robfarley.blogspot.com/&quot;&gt;jet-setting leader&lt;/a&gt;, or the great speakers, but we are getting regular crowds of 30+ and I&apos;m always learning something new each time I go.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2006/03/cumulative-hotfix-for-sql-server-2000</id>
    <updated>2006-03-24T09:24:00.000+10:30</updated>
    <title>Cumulative Hotfix for SQL Server 2000 Service Pack 4 - Build 2187 for x86 and x64 Based Systems</title>
    <link href="https://david.gardiner.net.au/2006/03/cumulative-hotfix-for-sql-server-2000" rel="alternate" type="text/html" title="Cumulative Hotfix for SQL Server 2000 Service Pack 4 - Build 2187 for x86 and x64 Based Systems"/>
    <category term="SQL Server"/>
    <published>2006-03-24T09:24:00.000+10:30</published>
    <summary type="html">This package contains all hotfixes that are available for SQL Server 2000 Service Pack 4 prior to build 2187.</summary>
    <content type="html">&lt;p&gt;This package contains all hotfixes that are available for SQL Server 2000 Service Pack 4 prior to build 2187.&lt;/p&gt;
&lt;p&gt;This build contains hotfixes that were available for SQL Server 2000 Service Pack 3 build 1031 but were not included in SQL Server 2000 Service Pack 4.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2006/03/how-delete-all-data-in-all-tables-in</id>
    <updated>2006-03-15T15:35:00.000+10:30</updated>
    <title>How delete all the data in all the tables in your database</title>
    <link href="https://david.gardiner.net.au/2006/03/how-delete-all-data-in-all-tables-in" rel="alternate" type="text/html" title="How delete all the data in all the tables in your database"/>
    <category term="SQL Server"/>
    <published>2006-03-15T15:35:00.000+10:30</published>
    <summary type="html">Adi has a nice way of removing all the data.</summary>
    <content type="html">&lt;p&gt;Adi has a nice way of removing all the data. The only change I made was to use &quot;DELETE FROM&quot; instead of &quot;TRUNCATE TABLE&quot; so that it works with foreign keys.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2005/07/microsoft-sql-server-2005-upgrade</id>
    <updated>2005-07-07T09:31:00.000+09:30</updated>
    <title>Microsoft SQL Server 2005 Upgrade Advisor</title>
    <link href="https://david.gardiner.net.au/2005/07/microsoft-sql-server-2005-upgrade" rel="alternate" type="text/html" title="Microsoft SQL Server 2005 Upgrade Advisor"/>
    <category term="SQL Server"/>
    <published>2005-07-07T09:31:00.000+09:30</published>
    <summary type="html">Download details: Microsoft SQL Server 2005 Upgrade Advisor: &quot;The Microsoft SQL Server 2005 Upgrade Advisor is a tool used by Database developers and administrators to analyze SQL Server 7.0 and SQL Server 2000.</summary>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=cf28daf9-182e-4ac2-8e88-f2e936558bf2&amp;amp;DisplayLang=en&quot;&gt;Download details: Microsoft SQL Server 2005 Upgrade Advisor&lt;/a&gt;: &quot;The Microsoft SQL Server 2005 Upgrade Advisor is a tool used by Database developers and administrators to analyze SQL Server 7.0 and SQL Server 2000 database servers in preparation for upgrading to SQL Server 2005&quot;&lt;/p&gt;
</content>
  </entry>
</feed>
