<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>SQL Joint</title>
  <link rel="alternate" type="text/html" href="http://www.sqljoint.com/" />
  <link rel="self" href="http://www.sqljoint.com/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2006-03-10T13:34:29.1441227+01:00</updated>
  <author>
    <name>Sune Hansen</name>
  </author>
  <subtitle>Den digitale SQL hukommelse</subtitle>
  <id>http://www.sqljoint.com/</id>
  <generator uri="http://www.dasblog.net" version="1.8.5223.1">DasBlog</generator>
  <entry>
    <title>Jeg hader SQL Server</title>
    <link rel="alternate" type="text/html" href="http://www.sqljoint.com/Jeg+Hader+SQL+Server.aspx" />
    <id>http://www.sqljoint.com/PermaLink,guid,0ce4eceb-5bb3-4c29-9b67-bc15213855b9.aspx</id>
    <published>2006-03-10T13:33:46.9420000+01:00</published>
    <updated>2006-03-10T13:34:29.1441227+01:00</updated>
    <category term="SQL Server" label="SQL Server" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Okay, jeg synes nu egentlig meget godt om SQL Server, men det er jo ikke alle der
      deler min mening:
   </p>
        <p>
          <a href="http://weblogs.sqlteam.com/jeffs/archive/2005/05/24/5248.aspx">Top 10 Things
      I Hate About SQL Server</a>
        </p>
        <p>
      Husk også at læse kommentarerne :o)
   </p>
        <img width="0" height="0" src="http://www.sqljoint.com/aggbug.ashx?id=0ce4eceb-5bb3-4c29-9b67-bc15213855b9" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Antal gange et ord findes i en kolonne</title>
    <link rel="alternate" type="text/html" href="http://www.sqljoint.com/Antal+Gange+Et+Ord+Findes+I+En+Kolonne.aspx" />
    <id>http://www.sqljoint.com/PermaLink,guid,719e3aee-f2bb-4d1a-ad87-8885983bf34c.aspx</id>
    <published>2005-11-25T15:55:44.2110269+01:00</published>
    <updated>2005-11-25T15:55:44.2110269+01:00</updated>
    <category term="T-SQL" label="T-SQL" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Det er ikke de helt vildt streng funktioner, der findes i T-SQL (okay, måske bliver
      jeg klogere, når jeg får sat mig mere ind i T-SQL udvidelserne i SQL Server 2005,
      men i hvert fald ikke i SQL Server 2000). Men selv med de simple funktioner kan man
      lave nogle små fikse ting, hvis det bliver sat rigtigt sammen. I det følgende skal
      vi finde ud af, hvor mange gange et bestemt ord findes i en kolonne. 
   </p>
        <p>
      Vi har følgende table:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CREATE</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">TABLE</span> tbl_Demo
      (<br />
          DemoID <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">INT</span>,<br />
          Description <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">VARCHAR</span>(8000)<br />
      )    </span>
        </p>
        <p>
      I den tabel vil vi finde ud af hvor mange gange order "server" i hver rækkes Description
      felt. Det kan gøres på følgende måde:
   </p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> Description,
      (<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">LEN</span>(Description)
      - <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">LEN</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(Description, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'server'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">''</span>)))
      / <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">LEN</span>(<span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'server'</span>) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> WordCount<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> tbl_Demo</span>
          </p>
        </span>
        <p>
      Vi tager kort fortalt længden af Description feltet inkl. alle gange order "server"
      måtte optræde, og trækker længden af Description feltet uden ordet "server" fra. For
      at finde antallet af gang ’server’ indgår dividerer vi dette tal med længden af "server".
   </p>
        <p>
      Ved også at bruge udtrykket i en Order By kan vores statement tilmed bruges som en
      søgefunktion, der sortere de mest relevante resultater øverst:
   </p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> Description,
      (<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">LEN</span>(Description)
      - <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">LEN</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(Description, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'server'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">''</span>)))
      / <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">LEN</span>(<span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'server'</span>) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> WordCount<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> tbl_Demo<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ORDER</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span> WordCount <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">DESC</span></span>
            </p>
          </span>
        </span>
        <p>
      Måske ikke lige frem optimalt hvad angår performance, men trods alt en prioriteret
      søgning.
   </p>
        <img width="0" height="0" src="http://www.sqljoint.com/aggbug.ashx?id=719e3aee-f2bb-4d1a-ad87-8885983bf34c" />
      </div>
    </content>
  </entry>
  <entry>
    <title>SQLCAT - SQL Server service?</title>
    <link rel="alternate" type="text/html" href="http://www.sqljoint.com/SQLCAT++SQL+Server+Service.aspx" />
    <id>http://www.sqljoint.com/PermaLink,guid,a7ae1b62-0444-4015-9c02-ff432cc570cd.aspx</id>
    <published>2005-11-18T13:18:39.9750000+01:00</published>
    <updated>2005-11-18T13:18:39.9756837+01:00</updated>
    <category term="SQL Server" label="SQL Server" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Niks, det er derimod den seneste blog på min rulle. <a href="http://blogs.msdn.com/sqlcat/default.aspx">Microsoft
      SQL Server Development Customer Advisory Team</a> er det mundrette navn på denne forholdsvis
      nye blog med best practices og erfaringer fra nogle af verdens mest krævende SQL Server
      installationer.
   </p>
        <p>
      Mon ikke de fleste af os kan lære lidt når så <a href="http://blogs.msdn.com/sqlcat/archive/2005/08/29/457503.aspx">erfarne
      folk</a> begynder at dele lidt ud?
   </p>
        <img width="0" height="0" src="http://www.sqljoint.com/aggbug.ashx?id=a7ae1b62-0444-4015-9c02-ff432cc570cd" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Gratis Microsoft eLearning om SQL Server 2005</title>
    <link rel="alternate" type="text/html" href="http://www.sqljoint.com/Gratis+Microsoft+ELearning+Om+SQL+Server+2005.aspx" />
    <id>http://www.sqljoint.com/PermaLink,guid,991b0b5a-c22d-4758-9e36-5d36d0fffae8.aspx</id>
    <published>2005-11-11T11:46:01.6590000+01:00</published>
    <updated>2005-11-13T13:20:24.9908810+01:00</updated>
    <category term="SQL Server" label="SQL Server" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Microsoft tilbyder i hele november 8 gratis eLearning kurser om SQL Server med emner
      som:
   </p>
        <ul>
          <li>
         Installing and Securing Microsoft SQL Server 2005 
      </li>
          <li>
         Programming SQL Server 2005 
      </li>
          <li>
         Creating the Data Access Tier Using Microsoft SQL Server 2005 
      </li>
          <li>
         New Features of Microsoft SQL Server 2005 Analysis Services</li>
        </ul>
        <p>
      Kurserne findes på <a href="https://www.microsoftelearning.com/catalog/default.aspx">https://www.microsoftelearning.com/catalog/default.aspx</a>,
      og kan downloades, så de kan ses offline.
   </p>
        <p>
      Som om det ikke er nok, er der ind til 17. november 7 gratis Visual Studio 2005 kurser,
      som også kan downloades. Efter download har du 90 dage til at få dem set, så det er
      bare med at komme i gang.
   </p>
        <img width="0" height="0" src="http://www.sqljoint.com/aggbug.ashx?id=991b0b5a-c22d-4758-9e36-5d36d0fffae8" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Objekt hjælp og keyboard genveje</title>
    <link rel="alternate" type="text/html" href="http://www.sqljoint.com/Objekt+Hj%c3%a6lp+Og+Keyboard+Genveje.aspx" />
    <id>http://www.sqljoint.com/PermaLink,guid,5b625648-768c-47fe-b29e-b6e433ede026.aspx</id>
    <published>2005-11-09T16:06:50.4570000+01:00</published>
    <updated>2005-11-09T16:06:50.4571955+01:00</updated>
    <category term="SQL Server Management Studio" label="SQL Server Management Studio" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <span id="lblMessage">
            <span id="lblMessage">
              <span id="lblMessage">
                <span id="lblMessage">
                  <span id="lblMessage">
                    <span id="lblMessage">
                      <span id="lblMessage">En
      hurig måde i Management Studio eller Query Analyzer at få oplysninger om objektet
      tbl_Product i følgende query:</span>
                    </span>
                  </span>
                </span>
              </span>
            </span>
          </span>
        </p>
        <span>
          <span>
            <span>
              <span>
                <span>
                  <span>
                    <span>
                      <p>
                        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> * <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> tbl_Product</span>
                      </p>
                    </span>
                  </span>
                </span>
              </span>
            </span>
          </span>
        </span>
        <p>
          <span>
            <span>
              <span>
                <span>
                  <span>
                    <span>
                      <span>er at markere objektnavnet og trykke ALT+F1.</span>
                    </span>
                  </span>
                </span>
              </span>
            </span>
          </span>
        </p>
        <p>
          <span>
            <span>
              <span>
                <span>
                  <span>
                    <span>
                      <span>Dette svarer til at eksekvere</span>
                    </span>
                  </span>
                </span>
              </span>
            </span>
          </span>
        </p>
        <span>
          <span>
            <span>
              <span>
                <span>
                  <span>
                    <span>
                      <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                        <p>
                          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SP_HELP
      tbl_Product</span>
                        </p>
                      </span>
                    </span>
                  </span>
                </span>
              </span>
            </span>
          </span>
        </span>
        <p>
          <span>
            <span>
              <span>
                <span>
                  <span>
                    <span>
                      <span>og returnerer alle objektdetaljer, som kolonne
      oplysninger, index information og constraints. </span>
                    </span>
                  </span>
                </span>
              </span>
            </span>
          </span>
        </p>
        <img width="0" height="0" src="http://www.sqljoint.com/aggbug.ashx?id=5b625648-768c-47fe-b29e-b6e433ede026" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Skift kompatibilitets niveau på din database</title>
    <link rel="alternate" type="text/html" href="http://www.sqljoint.com/Skift+Kompatibilitets+Niveau+P%c3%a5+Din+Database.aspx" />
    <id>http://www.sqljoint.com/PermaLink,guid,4e48eec6-b168-4962-96cd-8702d5e7d8e5.aspx</id>
    <published>2005-11-02T15:34:04.7420000+01:00</published>
    <updated>2005-11-02T15:34:43.1156578+01:00</updated>
    <category term="SQL Server" label="SQL Server" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Skal du udvikle noget, som skal kunne afvikles på en tidligere version af SQL Server
      end din udviklingsmaskine, kan du med fordel ændre kompatibilitets niveau. Herved
      kan du sikre at din T-SQL er kompatibel med en tidligere version af SQL Server.
   </p>
        <p>
      Kompatibilitets niveau skiftes på følgende måde:
   </p>
        <p>
          <strong>SQL Server 2000</strong>
          <br />
      Højre klik på den aktuelle database i Enterprise Manager og vælg Properties. Vælg
      tabben Options og du har nu mulighed for at ændre kompatibilitets niveau.
   </p>
        <p>
          <strong>SQL Server 2005</strong>
          <br />
      Højreklik på den aktuelle database i Management Studio og vælg Properties. Vælg siden
      Options, og du har nu mulighed for at ændre kompatibilitets niveau i drop down boksen.
   </p>
        <p>
      Vær opmærksom på at SQL Server 2000 kan sættes til at være kompatibel med versioner
      helt tilbage til SQL Server 6.0, men SQL Server 2005 "kun" går tilbage til 7.0.
   </p>
        <img width="0" height="0" src="http://www.sqljoint.com/aggbug.ashx?id=4e48eec6-b168-4962-96cd-8702d5e7d8e5" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Case-sensitive WHERE clause ved case-insensitive collation</title>
    <link rel="alternate" type="text/html" href="http://www.sqljoint.com/Casesensitive+WHERE+Clause+Ved+Caseinsensitive+Collation.aspx" />
    <id>http://www.sqljoint.com/PermaLink,guid,84757242-b574-4b86-9397-d5059e77f03b.aspx</id>
    <published>2005-10-30T21:14:13.8000000+01:00</published>
    <updated>2005-10-31T08:14:08.8247930+01:00</updated>
    <category term="T-SQL" label="T-SQL" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Default collation på SQL Server er case-insensitive. Det er som oftest også det
      smarteste, så man ikke behøver koncentrere sig om at skrive f.eks. object navne med
      den rigtige case. Ind imellem kunne det dog være rart, hvis man kunne lave en case-sensitive
      WHERE-clause, f.eks. i forbindelse med, at en bruger angiver password til login.
   </p>
        <p>
      Eks:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> * <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> tbl_User <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span> Password
      = <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'superfly'</span></span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            </span>
          </span>Denne
      returnerer både dem der har password: superfly, Superfly, SUPERFLY og lign., hvilket
      ikke er hensigtsmæssigt.<br />
       <br />
      Følgende lille trick giver til gengæld det ønskede resultat:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> * <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> tbl_User <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span><span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CONVERT</span>(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BINARY</span>,
      Password) = <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CONVERT</span>(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BINARY</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'superfly'</span>)</span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          </span>Nu
      vil kun brugere med password superfly blive returneret. Den binære værdi for f.eks.
      s og S er forskellig, så nu risikerer vi ikke at få uønskede rækker returneret.
   </p>
        <p>
      Den betænksomme SQL programmør vil nu gøre opmærksom på, at et evt. index på kolonnen
      Password ikke længere vil kunne anvendes, men at der vil skulle en table-scan til
      for at finde den ønskede brugere.
   </p>
        <p>
      Dette kan man komme ud over med denne færdig SELECT:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> *
      FORM tbl_User <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span> Password
      = <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'superfly'</span><span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AND</span><span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CONVERT</span>(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BINARY</span>,
      Password) = <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CONVERT</span>(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BINARY</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'superfly'</span>)</span>
        </p>
        <p>
      Et index kan nu anvendes til at finde de brugere, der har password superfly i en elle
      anden form, og til sidst fjernes de brugere, der så ikke har det på den rigtige form
      (den rigtige case).
   </p>
        <p>
      Vores mål er nu nået og vi har lavet en case-sensitive WHERE-clause på en database
      med case-insensitive collation.<br /></p>
        <img width="0" height="0" src="http://www.sqljoint.com/aggbug.ashx?id=84757242-b574-4b86-9397-d5059e77f03b" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Keyboard Shortcuts i SQL Server 2005</title>
    <link rel="alternate" type="text/html" href="http://www.sqljoint.com/Keyboard+Shortcuts+I+SQL+Server+2005.aspx" />
    <id>http://www.sqljoint.com/PermaLink,guid,77c7a6f7-4766-4c2f-8f04-a8119da56192.aspx</id>
    <published>2005-10-28T15:31:01.4740000+02:00</published>
    <updated>2005-10-28T15:36:15.0404489+02:00</updated>
    <category term="SQL Server Management Studio" label="SQL Server Management Studio" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      SQL Server 2005 Management Studio tilbyder to keyboard skemaer. Nu hvor SQL Server
      arbejdet foregår i en Visual Studio skal, er default meget naturligt baseret herpå.
      Du har dog også mulighed for at vælge et skema kaldet SQL Server 2000, hvis du er
      lidt mere nostalgisk.
   </p>
        <p>
      Det betyder selvfølgelig, at du skal lære nogle nye genveje (i hvert fald hvis du
      vil bruge default skemaet), men hvis du i forvejen også udvikler i Visual
      Studio.NET kommer det hurtigt, og så er det rart ikke at skulle huske to forskellige
      genveje til f.eks. kommentere den valgte tekst ud og ind.
   </p>
        <p>
      Kommenter ud:<br />
      CTRL+SHIFT+C bliver til CTRL+K, CTRL+C
   </p>
        <p>
      Kommenter ind:<br />
      CTRL+SHIFT+R bliver til CTRLl+K, CTRL+U
   </p>
        <p>
          <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/qryanlzr/qryanlzr_7f8z.asp">Alle
      genveje til SQL Server 2000 Qyery Analyser</a>
        </p>
        <p>
          <a href="http://msdn2.microsoft.com/en-us/library/ms174205#">Alle genveje til SQL
      Server 2005 Management Studio</a>
        </p>
        <p>
      Nå, ja. Hvis dette er den eneste blog, du læser, skulle jeg nok lige sige, at SQL
      Server 2005 og Visual Studio 2005 i dag er kommet til download på MSDN. Hvis dette
      ikke er den eneste blog, du læser, har du nok allerede lukket dette vindue - der er
      grænser for hvor mange gange, man gider læse det samme.
   </p>
        <img width="0" height="0" src="http://www.sqljoint.com/aggbug.ashx?id=77c7a6f7-4766-4c2f-8f04-a8119da56192" />
      </div>
    </content>
  </entry>
  <entry>
    <title>En klassiker - slet dubletter i en tabel</title>
    <link rel="alternate" type="text/html" href="http://www.sqljoint.com/En+Klassiker++Slet+Dubletter+I+En+Tabel.aspx" />
    <id>http://www.sqljoint.com/PermaLink,guid,111ca509-c2e1-44b7-80d0-3c2de021f73d.aspx</id>
    <published>2005-10-26T16:25:13.9370000+02:00</published>
    <updated>2005-10-26T16:25:13.9374217+02:00</updated>
    <category term="T-SQL" label="T-SQL" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Som nævnt tidligere er denne blog også lidt at betragte som min digitale hukommelse.
      Efterhånden er jeg ved at have fundet disse SQL statements så mange gange i mine andre
      arkiver, at de er ved at hænge ved. Men måske der er andre, der ikke har så meget
      orden i papirarkiverne som jeg(!?!), og som finde det lettere at slå op på nettet.
      Her kommer 3 metoder til at slette dubletter i en tabel:
   </p>
        <p>
      Vi vil gå ud fra en tabel med personer, som har følgende definition:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CREATE</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">TABLE</span> tbl_Person
      (<br />
      Id <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">INT</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">IDENTITY</span>(1,
      1),<br />
      FirstName <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">VARCHAR</span>(50),<br />
      LastName <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">VARCHAR</span>(50)<br />
      )</span>
        </p>
        <p>
      og målet er at slette dubletter af kombinationen FirstName og LastName.
   </p>
        <p>
      Metode 1:<br /><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">DELETE</span> tbl_Person<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> tbl_Person <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> P1<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span><span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">EXISTS</span> (<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> 1 <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> tbl_Person <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> P2 <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span> P2.Id
      &gt; P1.Id <span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">and</span> P1.FirstName
      = P2.FirstName <span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">and</span> P1.LastName
      = P2.LastName)</span></p>
        <p>
      Skeler man til performance er denne metode noget af det mest effektive man kan komme
      op med.
   </p>
        <p>
      Metode 2:<br /><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">DELETE</span> P1<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> tbl_Person <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> P1<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">INNER</span><span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">JOIN</span> tbl_Person <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> P2 <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ON</span> P1.FirstName
      = P2.FirstName <span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AND</span> P1.LastName
      = P2.LastName <span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AND</span> P1.Id
      &gt; P2.Id</span></p>
        <p>
      Og endelig metode 3:<br /><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">DELETE</span> tbl_Person<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> tbl_Person <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> P1<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span> Id
      &gt; (<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span><span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">MIN</span>(Id)<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> tbl_Person <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> P2<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span> P1.FirstName
      = P2.FirstName<br /><span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AND</span> P1.LastName
      = P2.LastName)</span></p>
        <p>
      Alle tre metoder gør det samme, nemlig sletter dubletter. Som altid når man sletter
      flere rækker er det en god idé at SELECT’e rækkerne ud før man sletter dem, så man
      sikrer at det ser rigtigt ud.
   </p>
        <img width="0" height="0" src="http://www.sqljoint.com/aggbug.ashx?id=111ca509-c2e1-44b7-80d0-3c2de021f73d" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Velkommen til SQLJoint</title>
    <link rel="alternate" type="text/html" href="http://www.sqljoint.com/Velkommen+Til+SQLJoint.aspx" />
    <id>http://www.sqljoint.com/PermaLink,guid,73901d67-0911-4b8e-8f56-1f08e7c49a49.aspx</id>
    <published>2005-10-25T19:45:14.7730000+02:00</published>
    <updated>2005-10-25T20:34:58.1433577+02:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Så skete det! Efter længere tids moderat (fysisk(?)) pres fik jeg endelig presset
      min kollega, <a href="http://www.publicvoid.dk">Søren Lund</a>, til at sætte
      dasBlog op til mig, så jeg kan få gang i SQLJoint igen. Hermed er jeg også klar til
      at tage skridtet ind i det 21. århundrede - det var ved at blive lidt ensomt tilbage
      i den 20.
   </p>
        <p>
      Sitet vil hovedsagelige komme til at indeholde posts, der på den ene eller anden måde
      har med SQL Server at gøre: T-SQL, DTS, Integration Services, Analysis Services osv.
      Skulle jeg falde over et andet udvikler relateret trick, kunne det også ske at finde
      vej til denne digitale udgave af min hukommelse. Endelig kan det ikke udelukkes, at
      der vil snige sig en enkelt eller to komplet irrelevante - set med SQL Server eller
      udvikler øjne - posts ind.
   </p>
        <p>
      - Sune
   </p>
        <img width="0" height="0" src="http://www.sqljoint.com/aggbug.ashx?id=73901d67-0911-4b8e-8f56-1f08e7c49a49" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Congratulations, you've installed DasBlog!</title>
    <link rel="alternate" type="text/html" href="http://www.sqljoint.com/Congratulations+Youve+Installed+DasBlog.aspx" />
    <id>http://www.sqljoint.com/PermaLink,guid,b705c37b-b47f-4e8d-8f8b-091efc4cb684.aspx</id>
    <published>2005-07-20T09:00:00.0000000+02:00</published>
    <updated>2005-07-21T08:10:18.9161264+02:00</updated>
    <category term="dasBlog" label="dasBlog" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Be sure to visit all the options undfer "Configuration" in the Admin Menu Bar above.
      There are 16 themes to choose from, and you can also create your own.
   </p>
        <p>
        </p>
        <img width="0" height="0" src="http://www.sqljoint.com/aggbug.ashx?id=b705c37b-b47f-4e8d-8f8b-091efc4cb684" />
      </div>
    </content>
  </entry>
</feed>