<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Todd Taylor's Blog - SQL</title>
    <link>http://blog.toddtaylor.com/</link>
    <description />
    <language>en-us</language>
    <copyright>Todd M. Taylor</copyright>
    <lastBuildDate>Sat, 04 Nov 2006 23:02:20 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>toddtaylor@toddtaylor.com</managingEditor>
    <webMaster>toddtaylor@toddtaylor.com</webMaster>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=c467e98a-4101-4b06-b90f-57a9f3625c67</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,c467e98a-4101-4b06-b90f-57a9f3625c67.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,c467e98a-4101-4b06-b90f-57a9f3625c67.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=c467e98a-4101-4b06-b90f-57a9f3625c67</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
While attempting to retrieve a list of installed databases on my PC using <a href="http://www.csharphelp.com/archives2/archive342.html">SQLDMO
in C#</a>, I found that the named instances of SQL never showed-up no matter what
I did.  Since my PC only has two named instances of SQL server installed and
no default instances, this created a problem!
</p>
        <p>
As it turns-out, the <a href="http://blogs.msdn.com/sql%20protocols/archive/2005/09/24/473502.aspx" target=" blank">Windows
Firewall was blocking calls to the SQL Browser’s UDP port 1434</a>.  If you turn-off
your Windows Firewall, you should be able to retrieve all named instances of SQL Server
that are installed on your PC.  I opted to un-block this port so my app would
work.
</p>
      </body>
      <title>Getting SQL Named Instance with SQL DMO</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,c467e98a-4101-4b06-b90f-57a9f3625c67.aspx</guid>
      <link>http://blog.toddtaylor.com/2006/11/04/GettingSQLNamedInstanceWithSQLDMO.aspx</link>
      <pubDate>Sat, 04 Nov 2006 23:02:20 GMT</pubDate>
      <description>&lt;p&gt;
While attempting to retrieve a list of installed databases on my PC using &lt;a href="http://www.csharphelp.com/archives2/archive342.html"&gt;SQLDMO
in C#&lt;/a&gt;, I found that the named instances of SQL never showed-up no matter what
I did. &amp;nbsp;Since my PC only has two named instances of SQL server installed and
no default instances, this created a problem!
&lt;/p&gt;
&lt;p&gt;
As it turns-out, the &lt;a href="http://blogs.msdn.com/sql%20protocols/archive/2005/09/24/473502.aspx" target=" blank"&gt;Windows
Firewall was blocking calls to the SQL Browser’s UDP port 1434&lt;/a&gt;.&amp;nbsp; If you turn-off
your Windows Firewall, you should be able to retrieve all named instances of SQL Server
that are installed on your PC.&amp;nbsp; I opted to un-block this port so my app would
work.
&lt;/p&gt;
</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,c467e98a-4101-4b06-b90f-57a9f3625c67.aspx</comments>
      <category>C#</category>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=56e7107a-83c0-42aa-ad67-30e7ce2004d1</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,56e7107a-83c0-42aa-ad67-30e7ce2004d1.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,56e7107a-83c0-42aa-ad67-30e7ce2004d1.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=56e7107a-83c0-42aa-ad67-30e7ce2004d1</wfw:commentRss>
      <title>Intellisense for Query Analyzer</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,56e7107a-83c0-42aa-ad67-30e7ce2004d1.aspx</guid>
      <link>http://blog.toddtaylor.com/2006/05/23/IntellisenseForQueryAnalyzer.aspx</link>
      <pubDate>Tue, 23 May 2006 13:38:28 GMT</pubDate>
      <description>

&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;How cool is this?&amp;nbsp; &lt;a href="http://www.red-gate.com/"&gt;Red-Gate
Software&lt;/a&gt; has a free plug-in for Query Analyzer that gives you Intellisense&lt;span class=style1&gt;&amp;reg;&lt;/span&gt; support!
&amp;nbsp;&lt;a href="http://www.red-gate.com/products/SQL Prompt/index.htm"&gt;Click here to
get it&lt;/a&gt;.&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;

</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,56e7107a-83c0-42aa-ad67-30e7ce2004d1.aspx</comments>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=5f6d5646-6452-4043-8239-6f8ea7116419</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,5f6d5646-6452-4043-8239-6f8ea7116419.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,5f6d5646-6452-4043-8239-6f8ea7116419.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=5f6d5646-6452-4043-8239-6f8ea7116419</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="font-size:10.0pt;font-family:Arial">For those of you who use Visio to
due your database modeling, you might have run across the slight problem of not being
able to get rid of the auto-generated foreign-keys in your tables (assuming you might
have deleted and recreated a relation to the same table.)  If you try to generate
a database from your model, you’ll find that the foreign keys that you thought
you deleted still exist somewhere in ‘limbo’ and as a result, the error
checking in Visio goes crazy.</span>
          </p>
          <p class="MsoNormal">
            <span style="font-size:10.0pt;font-family:Arial">So, how do you get rid of these ‘phantom
foreign keys/relationships’?  Well, I found no solutions from Microsoft’s
web site, but I did find some work-arounds from a few blog posts.  Here are two
methods that seem to work:</span>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="font-size:10.0pt;font-family:Arial">Copy Data Structure into a New
File</span>
            </b>
          </p>
          <ol style="margin-top:0in" start="1" type="1">
            <li class="MsoNormal">
              <span style="font-size:10.0pt;font-family:Arial">Create a new database model diagram</span>
            </li>
            <li class="MsoNormal">
              <span style="font-size:10.0pt;font-family:Arial">Select all of the items in your existing
diagram and click Ctrl+C (Copy)</span>
            </li>
            <li class="MsoNormal">
              <span style="font-size:10.0pt;font-family:Arial">Paste the entire diagram into your
new diagram.  The “phantom” foreign keys will not be copied.</span>
            </li>
          </ol>
          <p class="MsoNormal">
            <b>
              <span style="font-size:10.0pt;font-family:Arial">View (and Delete) Related Tables</span>
            </b>
          </p>
          <ol style="margin-top:0in" start="1" type="1">
            <li class="MsoNormal">
              <span style="font-size:10.0pt;font-family:Arial">Right-click on the table with the
problem </span>
            </li>
            <li class="MsoNormal">
              <span style="font-size:10.0pt;font-family:Arial">Select "Show related tables"
and you should get the "phantom relationship" back </span>
            </li>
            <li class="MsoNormal">
              <span style="font-size:10.0pt;font-family:Arial">Select the relationship and delete
it</span>
            </li>
          </ol>
          <p class="MsoNormal">
            <span style="font-size:10.0pt;font-family:Arial"> </span>
          </p>
        </div>
      </body>
      <title>Deleting Foreign Keys in Visio</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,5f6d5646-6452-4043-8239-6f8ea7116419.aspx</guid>
      <link>http://blog.toddtaylor.com/2006/05/09/DeletingForeignKeysInVisio.aspx</link>
      <pubDate>Tue, 09 May 2006 20:44:40 GMT</pubDate>
      <description>

&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;For those of you who use Visio to
due your database modeling, you might have run across the slight problem of not being
able to get rid of the auto-generated foreign-keys in your tables (assuming you might
have deleted and recreated a relation to the same table.)&amp;nbsp; If you try to generate
a database from your model, you&amp;#8217;ll find that the foreign keys that you thought
you deleted still exist somewhere in &amp;#8216;limbo&amp;#8217; and as a result, the error
checking in Visio goes crazy.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;So, how do you get rid of these &amp;#8216;phantom
foreign keys/relationships&amp;#8217;?&amp;nbsp; Well, I found no solutions from Microsoft&amp;#8217;s
web site, but I did find some work-arounds from a few blog posts.&amp;nbsp; Here are two
methods that seem to work:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Copy Data Structure into a New
File&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;ol style='margin-top:0in' start=1 type=1&gt;
&lt;li class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Create a new database model diagram&lt;/span&gt;
&lt;/li&gt;
&lt;li class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Select all of the items in your existing
diagram and click Ctrl+C (Copy)&lt;/span&gt;
&lt;/li&gt;
&lt;li class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Paste the entire diagram into your
new diagram.&amp;nbsp; The &amp;#8220;phantom&amp;#8221; foreign keys will not be copied.&lt;/span&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;View (and Delete) Related Tables&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;ol style='margin-top:0in' start=1 type=1&gt;
&lt;li class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Right-click on the table with the
problem &lt;/span&gt;
&lt;/li&gt;
&lt;li class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Select &amp;quot;Show related tables&amp;quot;
and you should get the &amp;quot;phantom relationship&amp;quot; back &lt;/span&gt;
&lt;/li&gt;
&lt;li class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Select the relationship and delete
it&lt;/span&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;font-family:Arial'&gt;&amp;nbsp;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;

</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,5f6d5646-6452-4043-8239-6f8ea7116419.aspx</comments>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=b1517702-ad4b-48e1-a6e3-b736e8a982cb</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,b1517702-ad4b-48e1-a6e3-b736e8a982cb.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,b1517702-ad4b-48e1-a6e3-b736e8a982cb.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b1517702-ad4b-48e1-a6e3-b736e8a982cb</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
On a recent project, I had to figure-out a way to dynamically display icons to represent
that status of projects that were being reported on using Microsoft SQL Server 2000
Reporting Services.  Based off of information in the report’s data, I needed
the report to show a different icon for projects that were either <em>behind
schedule</em> (value = -1), <em>on schedule</em> (value = 0), or <em>ahead of schedule</em> (value
= 1).  I initially thought this would be an easy task, but after spending nearly
a whole day researching and testing different methods for doing this, I found it was
not so easy!
</p>
          <p class="MsoNormal">
First of all, one must understand that an image that looks good on a monitor will
not print very clearly.  Most monitors have a resolution in the range of 72 to
96 dpi (so I’ve been told), where as an image should be <u>at least</u> 150 dpi (dots
per inch) in order to print with any clarity. Vector images that have ‘hard edges’
like the circle-shaped icons I had chosen definitely need to be saved at a resolution
higher than screen resolution.   Higher resolution images look very blurry
and pixilated when displayed on-screen but should print very nicely.  The end-user
must be made aware that just because the report looks terrible on-screen doesn’t mean
it will print that way!
</p>
          <p class="MsoNormal">
Knowing this, I recommend that if your goal is to have crisp graphics when the report
is printed, start by creating higher resolution graphics, most likely a JPEG in
the 300 dpi range.  If your reports will only be viewed on-screen, create lower
resolution images; I found that GIFs are fine for that.  Stay away from using
PNGs because the Reporting Services PDF generating doesn’t seem to like them.
</p>
          <p class="MsoNormal">
I opted to save my status icons as 300 dpi JPEGs after creatig them in Adobe Illustrator.  
I also found that the icons should be saved with dimensions (width and height) significantly
larger than the desired print dimensions.  When I tried to create icons that
were as small as I thought they needed to be, the end result was that they didn’t
look good on screen or in print.  Go figure.  The image dimensions
will be scaled down in the image control's properties in the report.
</p>
          <p class="MsoNormal">
When accessing images in SQL Reporting Services, you have several options. By dragging
an image control from the Visual Studio Toolbox, you’ll be presented with this dialog:<br /><br /><img title="Image Wizard" height="398" src="http://blog.toddtaylor.com/content/binary/ImageWizard.gif" width="450" border="1" /><br /><b>Figure 1: The Image Wizard dialog</b><br /><br />
Although I would’ve preferred that my dynamic icons be embedded into the report, I
couldn’t figure-out a way to dynamically display embedded images so I opted for using
images hosted on a web server.  If you know of a way to dynamically display embedded
images, I’m all ears!
</p>
          <p class="MsoNormal">
Because the Report Manager of SQL Server Report Services is a web site, I opted to
create an images folder in IIS to host any images I might use.  I figure that
if the person viewing the report can see the reports on the report web server, he
or she will also have the ability to see the images in the report.  Make sure
you test this before deploying your reports to a live environment.
</p>
          <p class="MsoNormal">
To do the actual ‘dirty work’ of determining which image to display, I had to resort
to using a combination of a custom code function and a custom expression in the image control's <i>Value</i> property. 
First off, here is the code I used:
</p>
          <p class="MsoNormal">
            <span style="FONT-FAMILY: 'Courier New'">Function ShowStatusImage(value as Object)
As String<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">      Dim
strURL as String<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">      strURL
= "http://&lt;Server Name&gt;/images/"<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">
              <br />
      Dim strImg as String<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">      Select
Case value<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">           
Case Nothing<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">                 
strImg = "iconschedule.jpg"<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">           
Case -1<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">                 
strImg = "iconschedulebehind.jpg"<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">           
Case 0<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">                 
strImg = "iconscheduleon.jpg"<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">           
Case 1<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">                 
strImg = "iconscheduleahead.jpg"<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">      End
Select<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">      Return
strURL &amp; strImg<br /></span>
            <span style="FONT-FAMILY: 'Courier New'">End Function</span>
            <br />
            <br />
This method must be placed in the report's code section which can be accessed by selecting <i>Report</i> -&gt; <i>Report
Properties</i> -&gt; <i>Code</i> (tab) in the VS.NET designer:<br /><br /><img title="Report Properties" height="368" src="http://blog.toddtaylor.com/content/binary/ReportProperties.gif" width="450" border="1" /><br /><b>Figure 2: The Report Properties window showing the dynamic image function</b><br /><br />
Note that it is <u>not</u> a good idea to use ‘localhost’ in the image URL as shown
in the image above.  Instead, use the PC name or IP address so you can be assured
that other people will be able to view the images from any where on your network.<br /><br />
So, how do you use this <span style="FONT-FAMILY: 'Courier New'">ShowStatusImage</span> function? 
That part is easy.  In the table cell where you want the image to be displayed,
drag an <i>image control</i> from the <i>Toolbox</i> into a cell in the report. 
In the <i>Data : Source</i> field, select <i>External</i>.  In the <i>Data :
Value</i> field, enter the following:<br /><br /><span style="FONT-FAMILY: 'Courier New'">=Code.ShowStatusImage(Fields!&lt;YourDynamicImageField&gt;.Value)<br /></span><br />
Obviously, you will have to insert whatever data field value you want to
use as the input parameter of the <span style="FONT-FAMILY: 'Courier New'">ShowStatusImage</span> function
which will determine which image is shown. Modify the <font face="Courier New">select</font> statement
in the function accordingly. The field I used obviously returned either
no value, -1, 0, or 1.  The figure below shows the properties I set for each
dynamic image:<br /><br /><img height="419" src="http://blog.toddtaylor.com/content/binary/image0031234.jpg" width="402" /><br /><b>Figure 2: Dynamic image field properties<br /></b><br />
Note that the <i>Layout : Size</i> property relates to the size of the report field
that the image control is in, not the size of the image control itself.  In
order to keep my icons from stretching to the size of the field they were in, I had
to set the <i>Layout : Sizing</i> property to <i>FitProportional</i>. I also found
that it was necessary to put some padding all the way around the field which reduced
the size of the image slightly and seemed to keep the edges of the image from being
cropped.  My icons are circle shaped, and without the padding, the circles kept
ending-up with flat sides. 
</p>
          <p class="MsoNormal">
I opted to select no <em>Data : MIMEtype</em> as the images were not being served
by the report itself.<br /><br />
Below is a screen shot of how my dynamic image fields look in the <em>Layout tab</em> of
the <em>VS.NET designer</em>.  Note the icon legend at the top of the report:<br /><br /><img height="379" src="http://blog.toddtaylor.com/content/binary/image004123.jpg" width="451" /><br /><b>Figure 3: Layout view of the report</b><br /><br />
And here a small snippet of the dynamic images in the report in <em>Preview mode</em>:<br /><br /><img height="226" src="http://blog.toddtaylor.com/content/binary/image00512.jpg" width="451" /><br /><b>Figure 4: Preview of the report</b><br /><br />
I know you’re thinking, “Those status icons look like crap! They’re all pixilated
and bumpy!” Yes, they do look terrible on-screen and look even worse when you try
to export the report as a PDF.  However, they look great on paper, which was
my goal.<br /><br /><b>An Alternate Approach (That Didn’t Work)</b><br /><br />
For those of you who know your fonts, you might notice that the icons I’ve chosen
look an awful lot like some of the characters in the Wingding font family… and that’s
because they are *inspired* by the Wingding fonts :-)  Instead of using actual
images as status icons, I tried using various icon looking fonts instead.  The
idea seemed great to me because I knew that fonts would look great on screen and print
well.  There was one problem with this plan, I knew that people would be generating
PDFs from my reports and Reporting Services does allow for embedding fonts into PDFs
:'(  As a result, I could print and view the reports directly from Report Manager
and the icons looked great, but when I exported to PDF, I ended-up with some other
crazy font symbols.
</p>
          <p class="MsoNormal">
If you know of a better way to display dynamic images than the way I demonstrated
here, please let me know!
</p>
        </div>
      </body>
      <title>Dynamic Images in SQL Server 2000 Reporting Services</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,b1517702-ad4b-48e1-a6e3-b736e8a982cb.aspx</guid>
      <link>http://blog.toddtaylor.com/2006/01/19/DynamicImagesInSQLServer2000ReportingServices.aspx</link>
      <pubDate>Thu, 19 Jan 2006 17:25:54 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
On a recent project, I had to figure-out a way to dynamically display icons to represent
that status of projects that were being reported on using Microsoft SQL Server 2000
Reporting Services.&amp;nbsp; Based off of information in the report’s data, I needed
the report to show a different icon for projects that were either&amp;nbsp;&lt;em&gt;behind
schedule&lt;/em&gt; (value = -1), &lt;em&gt;on schedule&lt;/em&gt; (value = 0), or &lt;em&gt;ahead of schedule&lt;/em&gt; (value
= 1).&amp;nbsp; I initially thought this would be an easy task, but after spending nearly
a whole day researching and testing different methods for doing this, I found it was
not so easy!
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
First of all, one must understand that an image that looks good on a monitor will
not print very clearly.&amp;nbsp; Most monitors have a resolution in the range of 72 to
96 dpi (so I’ve been told), where as an image should be &lt;u&gt;at least&lt;/u&gt; 150 dpi (dots
per inch) in order to print with any clarity. Vector images that have ‘hard edges’
like the circle-shaped icons I had chosen definitely need&amp;nbsp;to be saved at a&amp;nbsp;resolution
higher than screen resolution.&amp;nbsp;&amp;nbsp; Higher resolution images look very blurry
and pixilated when displayed on-screen but should print very nicely.&amp;nbsp; The end-user
must be made aware that just because the report looks terrible on-screen doesn’t mean
it will print that way!
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
Knowing this, I recommend that if your goal is to have crisp graphics when the report
is printed, start by creating higher resolution graphics, most likely a JPEG&amp;nbsp;in
the 300 dpi range.&amp;nbsp; If your reports will only be viewed on-screen, create lower
resolution images; I found that GIFs are fine for that.&amp;nbsp; Stay away from using
PNGs because the Reporting Services PDF generating doesn’t seem to like them.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
I opted to save my status icons as 300 dpi JPEGs after creatig them in Adobe Illustrator.&amp;nbsp;&amp;nbsp;
I also found that the icons should be saved with dimensions (width and height) significantly
larger than the desired print dimensions.&amp;nbsp; When I tried to create icons that
were as small as I thought they needed to be, the end result was that they didn’t
look good on screen or in print.&amp;nbsp; Go figure.&amp;nbsp; The image&amp;nbsp;dimensions
will be scaled down in the image control's properties in the report.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
When accessing images in SQL Reporting Services, you have several options. By dragging
an image control from the Visual Studio Toolbox, you’ll be presented with this dialog:&lt;br&gt;
&lt;br&gt;
&lt;img title="Image Wizard" height=398 src="http://blog.toddtaylor.com/content/binary/ImageWizard.gif" width=450 border=1&gt;
&lt;br&gt;
&lt;b&gt;Figure 1: The Image Wizard dialog&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
Although I would’ve preferred that my dynamic icons be embedded into the report, I
couldn’t figure-out a way to dynamically display embedded images so I opted for using
images hosted on a web server.&amp;nbsp; If you know of a way to dynamically display embedded
images, I’m all ears!
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
Because the Report Manager of SQL Server Report Services is a web site, I opted to
create an images folder in IIS to host any images I might use.&amp;nbsp; I figure that
if the person viewing the report can see the reports on the report web server, he
or she will also have the ability to see the images in the report.&amp;nbsp; Make sure
you test this before deploying your reports to a live environment.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
To do the actual ‘dirty work’ of determining which image to display, I had to resort
to using a combination of a custom code function and a custom expression in the image&amp;nbsp;control's &lt;i&gt;Value&lt;/i&gt; property.&amp;nbsp;
First off, here is the code I used:
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;Function ShowStatusImage(value as Object)
As String&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim
strURL as String&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strURL
= "http://&amp;lt;Server Name&amp;gt;/images/"&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim strImg as String&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select
Case value&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Case Nothing&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
strImg = "iconschedule.jpg"&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Case -1&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
strImg = "iconschedulebehind.jpg"&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Case 0&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
strImg = "iconscheduleon.jpg"&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Case 1&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
strImg = "iconscheduleahead.jpg"&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End
Select&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return
strURL &amp;amp; strImg&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;End Function&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
This method must be placed in the report's code section which can be accessed by selecting &lt;i&gt;Report&lt;/i&gt; -&amp;gt; &lt;i&gt;Report
Properties&lt;/i&gt; -&amp;gt; &lt;i&gt;Code&lt;/i&gt; (tab) in the VS.NET designer:&lt;br&gt;
&lt;br&gt;
&lt;img title="Report Properties" height=368 src="http://blog.toddtaylor.com/content/binary/ReportProperties.gif" width=450 border=1&gt;
&lt;br&gt;
&lt;b&gt;Figure 2: The Report Properties window showing the dynamic image function&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
Note that it is &lt;u&gt;not&lt;/u&gt; a good idea to use ‘localhost’ in the image URL as shown
in the image above.&amp;nbsp; Instead, use the PC name or IP address so you can be assured
that other people will be able to view the images from any where on your network.&lt;br&gt;
&lt;br&gt;
So, how do you use this &lt;span style="FONT-FAMILY: 'Courier New'"&gt;ShowStatusImage&lt;/span&gt; function?&amp;nbsp;
That part is&amp;nbsp;easy.&amp;nbsp; In the table cell where you want the image to be displayed,
drag an &lt;i&gt;image control&lt;/i&gt; from the &lt;i&gt;Toolbox&lt;/i&gt; into a cell in the report.&amp;nbsp;
In the &lt;i&gt;Data : Source&lt;/i&gt; field, select &lt;i&gt;External&lt;/i&gt;.&amp;nbsp; In the &lt;i&gt;Data :
Value&lt;/i&gt; field, enter the following:&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;=Code.ShowStatusImage(Fields!&amp;lt;YourDynamicImageField&amp;gt;.Value)&lt;br&gt;
&lt;/span&gt;
&lt;br&gt;
Obviously, you will have to insert whatever data&amp;nbsp;field value&amp;nbsp;you want to
use as the input parameter of the &lt;span style="FONT-FAMILY: 'Courier New'"&gt;ShowStatusImage&lt;/span&gt;&amp;nbsp;function
which will determine which image is shown. Modify the &lt;font face="Courier New"&gt;select&lt;/font&gt; statement
in the&amp;nbsp;function&amp;nbsp;accordingly. The field I used obviously returned either
no value, -1, 0, or 1.&amp;nbsp; The figure below shows the properties I set for each
dynamic image:&lt;br&gt;
&lt;br&gt;
&lt;img height=419 src="http://blog.toddtaylor.com/content/binary/image0031234.jpg" width=402&gt;
&lt;br&gt;
&lt;b&gt;Figure 2: Dynamic image field properties&lt;br&gt;
&lt;/b&gt;
&lt;br&gt;
Note that the &lt;i&gt;Layout : Size&lt;/i&gt; property relates to the size of the report field
that the image control is in, not the size of the image control itself.&amp;nbsp;&amp;nbsp;In
order to keep my icons from stretching to the size of the field they were in, I had
to set the &lt;i&gt;Layout : Sizing&lt;/i&gt; property to &lt;i&gt;FitProportional&lt;/i&gt;. I also found
that it was necessary to put some padding all the way around the field which reduced
the size of the image slightly and seemed to keep the edges of the image from being
cropped.&amp;nbsp; My icons are circle shaped, and without the padding, the circles kept
ending-up with flat sides. 
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
I opted to select no &lt;em&gt;Data : MIMEtype&lt;/em&gt; as the images were not being served
by the report itself.&lt;br&gt;
&lt;br&gt;
Below is a screen shot of how my dynamic image fields look in the &lt;em&gt;Layout tab&lt;/em&gt; of
the &lt;em&gt;VS.NET designer&lt;/em&gt;.&amp;nbsp; Note the icon legend at the top of the report:&lt;br&gt;
&lt;br&gt;
&lt;img height=379 src="http://blog.toddtaylor.com/content/binary/image004123.jpg" width=451&gt;
&lt;br&gt;
&lt;b&gt;Figure 3: Layout view of the report&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
And here a small snippet of the dynamic images in the report in &lt;em&gt;Preview mode&lt;/em&gt;:&lt;br&gt;
&lt;br&gt;
&lt;img height=226 src="http://blog.toddtaylor.com/content/binary/image00512.jpg" width=451&gt;
&lt;br&gt;
&lt;b&gt;Figure 4: Preview of the report&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
I know you’re thinking, “Those status icons look like crap! They’re all pixilated
and bumpy!” Yes, they do look terrible on-screen and look even worse when you try
to export the report as a PDF.&amp;nbsp; However, they look great on paper, which was
my goal.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;An Alternate Approach (That Didn’t Work)&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
For those of you who know your fonts, you might notice that the icons I’ve chosen
look an awful lot like some of the characters in the Wingding font family… and that’s
because they are *inspired* by the Wingding fonts :-) &amp;nbsp;Instead of using actual
images as status icons, I tried using various icon looking fonts instead.&amp;nbsp; The
idea seemed great to me because I knew that fonts would look great on screen and print
well.&amp;nbsp; There was one problem with this plan, I knew that people would be generating
PDFs from my reports and Reporting Services does allow for embedding fonts into PDFs
:'(&amp;nbsp; As a result, I could print and view the reports directly from Report Manager
and the icons looked great, but when I exported to PDF, I ended-up with some other
crazy font symbols.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
If you know of a better way to display dynamic images than the way I demonstrated
here, please let me know!
&lt;/p&gt;
&lt;/div&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,b1517702-ad4b-48e1-a6e3-b736e8a982cb.aspx</comments>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=2b81501a-a0f2-459e-a6b1-0360f6d75f8f</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,2b81501a-a0f2-459e-a6b1-0360f6d75f8f.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,2b81501a-a0f2-459e-a6b1-0360f6d75f8f.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=2b81501a-a0f2-459e-a6b1-0360f6d75f8f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
When writing SQL statements, it's a good practice to always use "AS" after calling
each field. This will allow for column name changes that won't break your code. 
For example, the following is a simple SELECT statement:
</p>
        <p>
          <font face="Courier New">SELECT <em>Id</em> AS UserId, <em>FirstName</em> AS FirstName, <em>LastName</em> AS
LastName FROM Users</font>
        </p>
        <p>
If some of the column names change, such as the FirstName and LastName columns, my
code won't break:
</p>
        <p>
          <font face="Courier New">SELECT <em>Id</em> AS UserId, <em>FirstName</em> AS NameFirst, <em>NameLast</em> AS
LastName FROM Users</font>
        </p>
        <p>
Thanks to <a href="http://jelle.druyts.net/PermaLink.aspx?guid=61676665-06a7-443a-9462-71dae713539e">Jelle
Druyts</a> for this useful tip.
</p>
      </body>
      <title>Abstraction in SQL Queries</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,2b81501a-a0f2-459e-a6b1-0360f6d75f8f.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/11/21/AbstractionInSQLQueries.aspx</link>
      <pubDate>Mon, 21 Nov 2005 22:21:18 GMT</pubDate>
      <description>&lt;p&gt;
When writing SQL statements, it's a good practice to always use "AS" after calling
each field. This will allow for column name changes that won't break your code.&amp;nbsp;
For example, the following is a simple SELECT statement:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;SELECT &lt;em&gt;Id&lt;/em&gt; AS UserId, &lt;em&gt;FirstName&lt;/em&gt; AS FirstName, &lt;em&gt;LastName&lt;/em&gt; AS
LastName FROM Users&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
If some of the column names change, such as the FirstName and LastName columns, my
code won't break:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;SELECT &lt;em&gt;Id&lt;/em&gt; AS UserId, &lt;em&gt;FirstName&lt;/em&gt; AS NameFirst, &lt;em&gt;NameLast&lt;/em&gt; AS
LastName FROM Users&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
Thanks to &lt;a href="http://jelle.druyts.net/PermaLink.aspx?guid=61676665-06a7-443a-9462-71dae713539e"&gt;Jelle
Druyts&lt;/a&gt; for this useful tip.
&lt;/p&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,2b81501a-a0f2-459e-a6b1-0360f6d75f8f.aspx</comments>
      <category>ASP.NET</category>
      <category>SQL</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=21691202-2ea9-4252-9585-a8ed57ac9b18</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,21691202-2ea9-4252-9585-a8ed57ac9b18.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,21691202-2ea9-4252-9585-a8ed57ac9b18.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=21691202-2ea9-4252-9585-a8ed57ac9b18</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Neither humans nor computes can divide by zero, so if your SQL script has a variable
in the denominator of an equation, be sure to safe-guard against a potential divide-by-zero
error:
</p>
        <div class="code">
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CASE</span>
            <br />
    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHEN</span> @AveWorkDays
= 0 <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">THEN</span> 0<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ELSE</span><br />
    <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ISNULL</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SUM</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CAST</span>(ItemInventory.QtyDistributed <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">decimal</span>))/@AveWorkDays,
0)<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">END</span></span>
        </div>
      </body>
      <title>Avoiding Divide by Zero Error in Microsoft SQL</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,21691202-2ea9-4252-9585-a8ed57ac9b18.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/07/25/AvoidingDivideByZeroErrorInMicrosoftSQL.aspx</link>
      <pubDate>Mon, 25 Jul 2005 17:58:42 GMT</pubDate>
      <description>&lt;p&gt;
Neither humans nor computes can divide by zero, so if your SQL script has a variable
in the denominator of an equation, be sure to safe-guard against a potential divide-by-zero
error:
&lt;/p&gt;
&lt;div class=code&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;CASE&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;WHEN&lt;/span&gt; @AveWorkDays
= 0 &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;THEN&lt;/span&gt; 0&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ELSE&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ISNULL&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SUM&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;CAST&lt;/span&gt;(ItemInventory.QtyDistributed &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;decimal&lt;/span&gt;))/@AveWorkDays,
0)&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;END&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,21691202-2ea9-4252-9585-a8ed57ac9b18.aspx</comments>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://blog.toddtaylor.com/Trackback.aspx?guid=14d0e1c9-cdd1-4038-b0a8-dba841f7f932</trackback:ping>
      <pingback:server>http://blog.toddtaylor.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.toddtaylor.com/PermaLink,guid,14d0e1c9-cdd1-4038-b0a8-dba841f7f932.aspx</pingback:target>
      <dc:creator>Todd M. Taylor</dc:creator>
      <wfw:comment>http://blog.toddtaylor.com/CommentView,guid,14d0e1c9-cdd1-4038-b0a8-dba841f7f932.aspx</wfw:comment>
      <wfw:commentRss>http://blog.toddtaylor.com/SyndicationService.asmx/GetEntryCommentsRss?guid=14d0e1c9-cdd1-4038-b0a8-dba841f7f932</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Although I have to tinker with SQL,
I’m no DBA.  Upon doing some research for an up-coming project, I discovered
the Templates folder in Microsoft SQL Server 2000’s Query Analyzer.  However,
there was a problem… even though I installed the templates, they didn’t show-up in
the Query Analyzer Object Browser </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings">L</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">See all the pretty + boxes next
to each folder in the image below (indicating that each folder contains templates)? 
I didn’t have any of those… only the folders were appearing.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
              <img height="371" src="http://blog.toddtaylor.com/content/binary/image0011.gif" width="575" />
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">After racking-my-brain to figure-out
what search words to use to find help on this problem, I found the problem: Query
Analyzer won’t display template query files that are compressed with NTFS Compression.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">To fix this, I had to turn-off NTFS
Compression on each .tsql file.  To turn-off NTFS Compression:</span>
          </p>
          <ul type="disc">
            <li class="MsoNormal">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">To open My Documents, double-click
the <b>My Documents</b> icon on your desktop.<span id="para27"></span></span>
            </li>
            <li class="MsoNormal">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">You can also right-click a file
or folder and then click <b>Properties</b>. </span>
            </li>
            <li class="MsoNormal">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">To change properties for archiving,
indexing, compression, or encryption on NTFS drives, right-click the file or folder,
click <b>Properties</b>, click <b>Advanced</b>, and then select the options you want
to change. </span>
            </li>
          </ul>
        </div>
      </body>
      <title>Templates Not Showing in Query Analyzer's Object Browser</title>
      <guid isPermaLink="false">http://blog.toddtaylor.com/PermaLink,guid,14d0e1c9-cdd1-4038-b0a8-dba841f7f932.aspx</guid>
      <link>http://blog.toddtaylor.com/2005/05/18/TemplatesNotShowingInQueryAnalyzersObjectBrowser.aspx</link>
      <pubDate>Wed, 18 May 2005 16:47:35 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Although I have to tinker with SQL,
I’m no DBA.&amp;nbsp; Upon doing some research for an up-coming project, I discovered
the Templates folder in Microsoft SQL Server 2000’s Query Analyzer.&amp;nbsp; However,
there was a problem… even though I installed the templates, they didn’t show-up in
the Query Analyzer Object Browser &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings"&gt;L&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;See all the pretty + boxes next
to each folder in the image below (indicating that each folder contains templates)?&amp;nbsp;
I didn’t have any of those… only the folders were appearing.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;img height=371 src="http://blog.toddtaylor.com/content/binary/image0011.gif" width=575&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;After racking-my-brain to figure-out
what search words to use to find help on this problem, I found the problem: Query
Analyzer won’t display template query files that are compressed with NTFS Compression.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;To fix this, I had to turn-off NTFS
Compression on each .tsql file.&amp;nbsp; To turn-off NTFS Compression:&lt;/span&gt;
&lt;/p&gt;
&lt;ul type=disc&gt;
&lt;li class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;To open My Documents, double-click
the &lt;b&gt;My Documents&lt;/b&gt; icon on your desktop.&lt;span id=para27&gt;&lt;/span&gt;&gt;
&lt;/span&gt; 
&lt;li class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;You can also right-click a file
or folder and then click &lt;b&gt;Properties&lt;/b&gt;. &lt;/span&gt; 
&lt;li class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;To change properties for archiving,
indexing, compression, or encryption on NTFS drives, right-click the file or folder,
click &lt;b&gt;Properties&lt;/b&gt;, click &lt;b&gt;Advanced&lt;/b&gt;, and then select the options you want
to change. &lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description>
      <comments>http://blog.toddtaylor.com/CommentView,guid,14d0e1c9-cdd1-4038-b0a8-dba841f7f932.aspx</comments>
      <category>SQL</category>
    </item>
  </channel>
</rss>