<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4282742855636528649</id><updated>2011-05-04T06:48:06.967-07:00</updated><category term='import'/><category term='gif'/><category term='image'/><category term='game'/><category term='silverlight'/><category term='cluster'/><category term='full text index'/><category term='sql server'/><category term='bulk insert'/><title type='text'>An Awfully Big SQL Adventure</title><subtitle type='html'>SQL Server and .Net Excitement</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sqladventures.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4282742855636528649/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sqladventures.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Scott Dickens-Cook</name><uri>http://www.blogger.com/profile/01629275141615529863</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4282742855636528649.post-3875357143513817863</id><published>2011-05-04T06:44:00.000-07:00</published><updated>2011-05-04T06:46:12.242-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='gif'/><category scheme='http://www.blogger.com/atom/ns#' term='game'/><title type='text'>Problems Using GIF Images In SilverLight</title><content type='html'>When first getting to grips with Silverlight, I had some problems with images.&lt;br /&gt;&lt;br /&gt;I was creating a new Silverlight game for &lt;a href="http://www.play-free-games.com/"&gt;Play-Free-Games.com&lt;/a&gt;&amp;nbsp;("Panda Football" - yet another variant on the same old "Panda's playing football" theme one sees so often), and I was ready to start showing my Panda GIF images on screen.&lt;br /&gt;&lt;br /&gt;No matter what I tried, the images were not displayed. I figured I must be&amp;nbsp;specifying the path incorrectly, so I went through a long and tedious process of trying every possible relative or absolute method for defining the image path. I was on the point of tears when I&amp;nbsp;tried displaying another image I happened to have to hand (a picture of a sheep - no further details required). To my intense joy, the image loaded up&amp;nbsp;exactly as expected.&lt;br /&gt;&lt;br /&gt;My initial assumption was that SilverLight does not support images of pandas, only farmyard animals. I was about to&amp;nbsp;put this to the test by trying some goat, duck and chicken&amp;nbsp;images when I realised that there was&amp;nbsp;another key difference - my sheep pic was a jpg.&lt;br /&gt;&lt;br /&gt;"Surely the problem isn't simply that Silverlight does not support the GIF format", I thought to myself, but not for the first time that day I was so wrong:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://forums.silverlight.net/forums/p/39235/112333.aspx"&gt;http://forums.silverlight.net/forums/p/39235/112333.aspx&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;So, I converted my GIFs to PNGs and all was well. Cashback!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4282742855636528649-3875357143513817863?l=sqladventures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqladventures.blogspot.com/feeds/3875357143513817863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqladventures.blogspot.com/2011/05/problems-using-gif-images-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4282742855636528649/posts/default/3875357143513817863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4282742855636528649/posts/default/3875357143513817863'/><link rel='alternate' type='text/html' href='http://sqladventures.blogspot.com/2011/05/problems-using-gif-images-in.html' title='Problems Using GIF Images In SilverLight'/><author><name>Scott Dickens-Cook</name><uri>http://www.blogger.com/profile/01629275141615529863</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4282742855636528649.post-7328765624739206165</id><published>2011-03-13T14:24:00.000-07:00</published><updated>2011-03-13T14:24:06.140-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><category scheme='http://www.blogger.com/atom/ns#' term='import'/><category scheme='http://www.blogger.com/atom/ns#' term='bulk insert'/><title type='text'>Importing data into SQL Server from a text file using BULK INSERT</title><content type='html'>As a .Net / SQL Server developer it is often necessary to&amp;nbsp;import data in to your databases from other sources, such as text files. Ideally you would leave this&amp;nbsp;type of data manipulation activity to the kind of weirdos who enjoy it&amp;nbsp;(DBAs). Sadly however this is not always possible.&lt;br /&gt;&lt;br /&gt;Therefore, in the old days of SQL Server 2000 I often created DTS packages to suck in my data.&amp;nbsp;DTS was OK, especially the funky grey arrows, but&amp;nbsp;it was a little time consuming. Then - disaster - DTS was phased out in favour of SSIS. At No Frills Corp our DBAs have not been able to give me a server that SSIS actually works on, so I was a bit stuck.&lt;br /&gt;&lt;br /&gt;It was then that I came across the beatifully simple SQL command, BULK INSERT.&lt;br /&gt;&lt;br /&gt;Just point a BULK&amp;nbsp;INSERT command at your text file, tell it where to put the data, and you are all set. It can't be that easy can it? Yes, it really can:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;BULK INSERT Chimps&lt;br /&gt;   FROM 'D:\primates\chimps.csv'&lt;br /&gt;   WITH &lt;br /&gt;      (&lt;br /&gt;         FIELDTERMINATOR =',',&lt;br /&gt;         ROWTERMINATOR ='\n'&lt;br /&gt;      )&lt;br /&gt;&lt;/pre&gt;Cashback!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4282742855636528649-7328765624739206165?l=sqladventures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqladventures.blogspot.com/feeds/7328765624739206165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqladventures.blogspot.com/2011/03/importing-data-into-sql-server-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4282742855636528649/posts/default/7328765624739206165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4282742855636528649/posts/default/7328765624739206165'/><link rel='alternate' type='text/html' href='http://sqladventures.blogspot.com/2011/03/importing-data-into-sql-server-from.html' title='Importing data into SQL Server from a text file using BULK INSERT'/><author><name>Scott Dickens-Cook</name><uri>http://www.blogger.com/profile/01629275141615529863</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4282742855636528649.post-6965268949509668409</id><published>2011-03-04T13:39:00.000-08:00</published><updated>2011-05-04T06:47:27.499-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><category scheme='http://www.blogger.com/atom/ns#' term='cluster'/><title type='text'>Finding the active node in a SQL Server Cluster</title><content type='html'>DBAs are an eccentric breed aren't they?&lt;br /&gt;&lt;br /&gt;At my place of work, No Frills Corp, we have 2 types of DBA: DBAs who are perpetually on the edge of a nervous breakdown and will happily go a whole day without saying anything except "No", "I'm busy" and "Must be a problem with your app", and DBAs whom you should not engage in the simplest of conversations unless you have a couple of hours to spare.&lt;br /&gt;&lt;br /&gt;I much prefer the taciturn DBAs, but in both cases the best policy is not to talk to them unless you really have to. So, what if you just need to know something simple but important, like which node of our active-passive cluster is currently active?&lt;br /&gt;&lt;br /&gt;The other day I came across the very simple answer to this question:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SELECT ServerProperty('ComputerNamePhysicalNetBIOS')&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;Bosh!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4282742855636528649-6965268949509668409?l=sqladventures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqladventures.blogspot.com/feeds/6965268949509668409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqladventures.blogspot.com/2011/03/finding-active-node-in-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4282742855636528649/posts/default/6965268949509668409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4282742855636528649/posts/default/6965268949509668409'/><link rel='alternate' type='text/html' href='http://sqladventures.blogspot.com/2011/03/finding-active-node-in-sql-server.html' title='Finding the active node in a SQL Server Cluster'/><author><name>Scott Dickens-Cook</name><uri>http://www.blogger.com/profile/01629275141615529863</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4282742855636528649.post-8375434273434462248</id><published>2011-02-28T14:31:00.000-08:00</published><updated>2011-05-04T06:48:06.976-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='full text index'/><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><title type='text'>Dormant Full Text Index in SQL Server</title><content type='html'>I recently created a full text index to improve search performance on some large text fields. The resulting performance was great, so I took&amp;nbsp;it to show my boss&amp;nbsp;(an IT "Bruno").&lt;br /&gt;&lt;br /&gt;I had to wait a few minutes before I could see him, and then when I fired up my lovely new search&amp;nbsp;page disaster struck in the form of a timeout - making me look like an imbecile.&lt;br /&gt;&lt;br /&gt;I&amp;nbsp;covered by showing him something shiny, and&amp;nbsp;hastily hit refresh. The search came back in less than a second, as did each subsequent search. Happy boss.&lt;br /&gt;&lt;br /&gt;When I got back to my desk I did another search and got another timeout. It seems my Full Text Index is going to sleep if not used for&amp;nbsp;5 minutes, and then takes 30 seconds or more to wake up. Rubbish!&lt;br /&gt;&lt;br /&gt;So, I have had to set up a job to hit the FTI with a simple query every 5 minutes, keeping it "awake".&lt;br /&gt;&lt;br /&gt;Something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SELECT * FROM Dreams WHERE CONTAINS(SubText, 'fear of trombones')&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Doesn't feel great having to do that, but now my Full Text Index is always ready for action.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4282742855636528649-8375434273434462248?l=sqladventures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqladventures.blogspot.com/feeds/8375434273434462248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqladventures.blogspot.com/2011/02/dormant-full-text-index-in-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4282742855636528649/posts/default/8375434273434462248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4282742855636528649/posts/default/8375434273434462248'/><link rel='alternate' type='text/html' href='http://sqladventures.blogspot.com/2011/02/dormant-full-text-index-in-sql-server.html' title='Dormant Full Text Index in SQL Server'/><author><name>Scott Dickens-Cook</name><uri>http://www.blogger.com/profile/01629275141615529863</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4282742855636528649.post-2578450050688620255</id><published>2011-02-28T14:08:00.000-08:00</published><updated>2011-02-28T14:08:19.547-08:00</updated><title type='text'>Optional Search Parameters in SQL Server Stored Procedures</title><content type='html'>I often create Stored Procedures in SQL Server for searching - but what is the best way to handle optional search parameters?&lt;br /&gt;&lt;br /&gt;In the old days I wrote queries like this: &lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SELECT *&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;FROM Chimps&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;WHERE (@Age = 0 OR Age = @Age)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;AND (@Weight = 0 OR Weight = @Weight)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;... defaulting @Age and @Weight&amp;nbsp; to zero if not specified.&lt;br /&gt;&lt;br /&gt;However, I later found that this&amp;nbsp;performs a lot better:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SELECT *&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;FROM Chimps&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;WHERE Age = ISNULL(@Age, Age)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;AND Weight = ISNULL(@Weight, Weight)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;... with the params defaulting to NULL if not specified. Lovely.&lt;br /&gt;&lt;br /&gt;But wait! What if there is a chance that some of our chimps have a NULL value for Age or Weight? Then we would have to go a bit further:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SELECT *&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;FROM Chimps&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;WHERE ISNULL(Age, 0)&amp;nbsp;= COALESCE(@Age, Age, 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;AND ISNULL(Weight, 0)&amp;nbsp;= COALESCE(@Weight, Weight, 0)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This still performs well in most of my scenarios, but let's face it - ideally our chimps will not have a NULL weight. Weigh those chimps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4282742855636528649-2578450050688620255?l=sqladventures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqladventures.blogspot.com/feeds/2578450050688620255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sqladventures.blogspot.com/2011/02/optional-search-parameters-in-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4282742855636528649/posts/default/2578450050688620255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4282742855636528649/posts/default/2578450050688620255'/><link rel='alternate' type='text/html' href='http://sqladventures.blogspot.com/2011/02/optional-search-parameters-in-sql.html' title='Optional Search Parameters in SQL Server Stored Procedures'/><author><name>Scott Dickens-Cook</name><uri>http://www.blogger.com/profile/01629275141615529863</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
