<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>sql server on AdaTheDev Blog</title><link>https://www.adathedev.co.uk/tags/sql-server/</link><description>Recent content in sql server on AdaTheDev Blog</description><generator>Hugo -- gohugo.io</generator><managingEditor>adathedev@gmail.com (Adrian Hills)</managingEditor><webMaster>adathedev@gmail.com (Adrian Hills)</webMaster><lastBuildDate>Tue, 12 Aug 2014 16:03:00 +0100</lastBuildDate><atom:link href="https://www.adathedev.co.uk/tags/sql-server/index.xml" rel="self" type="application/rss+xml"/><item><title>dm_exec_query_plan returning NULL query plan</title><link>https://www.adathedev.co.uk/2014/08/dmexecqueryplan-returning-null-query.html</link><pubDate>Tue, 12 Aug 2014 16:03:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2014/08/dmexecqueryplan-returning-null-query.html</guid><description>&lt;p>I recently hit a scenario (SQL Server 2012 Standard, 11.0.5058) where I was trying to pull out the execution plan for a stored procedure from the plan cache, but the query shown below was returning a NULL query plan:&lt;/p></description></item><item><title>SQL Server 2008 R2 in-place upgrade error</title><link>https://www.adathedev.co.uk/2013/06/sql-server-2008-r2-in-place-upgrade.html</link><pubDate>Wed, 05 Jun 2013 21:18:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2013/06/sql-server-2008-r2-in-place-upgrade.html</guid><description>Today I encountered the following error during the process of performing an in-place upgrade of a SQL Server 2008 instance to 2008 R2:
The specified user 'someuser@somedomain.local' does not exist
I wasn&amp;rsquo;t initially sure what that related to - I hadn&amp;rsquo;t specified that account during the upgrade process so I went looking in the Services managemement console. The SQL Server service for the instance I was upgrading was configured to &amp;ldquo;Log On As&amp;rdquo; that account and it had been happily running prior to the upgrade.</description></item><item><title>GB Post Code Importer Conversion Accuracy Fix</title><link>https://www.adathedev.co.uk/2013/03/gb-post-code-importer-conversion.html</link><pubDate>Wed, 13 Mar 2013 23:09:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2013/03/gb-post-code-importer-conversion.html</guid><description>In a post last year (Ordnance Survey Data Importer Coordinate Conversion Accuracy) I looked into an accuracy issue with the conversion process within the GeoCoordConversion DLL that I use in this project (blog post). Bottom line, was that it was a minor with an average inaccuracy of around 2.5 metres and a max of ~130 metres by my reckoning. I&amp;rsquo;ve since had a few requests asking if I can supply an updated GeoCoordConversion DLL with fixes to the calculations.</description></item><item><title>SQL Server Table Designer Bug With Filtered Unique Index</title><link>https://www.adathedev.co.uk/2013/03/sql-server-table-designer-bug-with.html</link><pubDate>Fri, 08 Mar 2013 13:11:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2013/03/sql-server-table-designer-bug-with.html</guid><description>A colleague was getting a duplicate key error when trying to add a new column to a table via the Table Designer in SQL Server Management Studio (2008R2 - not tested on other versions), despite there being no violating data in the table. After a bit of digging around, I tracked the problem down to what appears to be a bug in Table Designer when there is a unique, filtered index in place on the table and the table is being recreated (i.</description></item><item><title>Ordnance Survey Data Importer Coordinate Conversion Accuracy</title><link>https://www.adathedev.co.uk/2012/03/ordnance-survey-data-importer.html</link><pubDate>Wed, 14 Mar 2012 22:11:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2012/03/ordnance-survey-data-importer.html</guid><description>Update 13 March 2013: Please see latest blog post (fix) on this here.
Thanks to a comment on my original post around my project that imports Ordnance Survey CodePoint data into SQL Server, I was made aware of a potential issue with the (awesome) third party GeoCoordConversion DLL I use to convert the Eastings/Northings coordinates supplied in the Ordnance Survey data files, into Latitude/Longitude coordinates. The issue relates to an inaccuracy in the conversion process, specifically to do with integer divisions instead of double.</description></item><item><title>Quick win - check your table variable use</title><link>https://www.adathedev.co.uk/2012/03/quick-win-check-your-table-variable-use.html</link><pubDate>Mon, 05 Mar 2012 09:30:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2012/03/quick-win-check-your-table-variable-use.html</guid><description>Quick wins are awesome. Making a change that takes minimal effort and yields a significant performance improvement is very satisfying.
This particular potential quick win relates to the use of table variables vs. temporary tables. Have a non-trivial stored procedure that produces some intermediary results and stores in a table variable which then goes on to be used further in the stored procedure? Consider evaluating a switch to a temporary table instead.</description></item><item><title>Excluding nodes from XML data before returning from SQL Server</title><link>https://www.adathedev.co.uk/2012/01/modifying-xml-data-before-returning.html</link><pubDate>Mon, 16 Jan 2012 10:36:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2012/01/modifying-xml-data-before-returning.html</guid><description>This post follows on from a question I recently replied to, for how to exclude a specific node from an XML column value before returning it, using TSQL.
Example setup CREATE TABLE Example ( ID INTEGER IDENTITY(1,1) PRIMARY KEY, XmlField XML ) INSERT Example (XmlField) VALUES (&amp;#39;&amp;lt;Root&amp;gt;&amp;lt;ChildA&amp;gt;Value I want to see&amp;lt;/ChildA&amp;gt;&amp;lt;ChildB&amp;gt;Value I do not want to see&amp;lt;/ChildB&amp;gt;&amp;lt;/Root&amp;gt;&amp;#39;) So if you want to return the XML minus the ChildB node, how do you do it?</description></item><item><title>sp_executesql change between 2005 and 2008</title><link>https://www.adathedev.co.uk/2011/06/spexecutesql-change-between-2005-and.html</link><pubDate>Mon, 27 Jun 2011 20:28:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2011/06/spexecutesql-change-between-2005-and.html</guid><description>Today I tripped over what turned out to be a difference in the way sp_executesql behaves between SQL Server 2005 and 2008 when executing a string containing a parameterised stored procedure call.
Take this simplified example:
DECLARE @SQL NVARCHAR(256) SET @SQL = &amp;#39;sp_help @obj&amp;#39; EXECUTE sp_executesql @SQL, N&amp;#39;@obj NVARCHAR(100)&amp;#39;, &amp;#39;sp_help&amp;#39; In SQL Server 2008 (10.0.4000.0), the above executes successfully.
In SQL Server 2005 (9.00.1399.06), it throws the following exception:
Msg 102, Level 15, State 1, Line 1 Incorrect syntax near &amp;#39;sp_help&amp;#39;.</description></item><item><title>The importance of "Working Set"</title><link>https://www.adathedev.co.uk/2011/06/importance-of-working-set.html</link><pubDate>Fri, 24 Jun 2011 20:55:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2011/06/importance-of-working-set.html</guid><description>One of the things that I see cropping up pretty often is this thing called &amp;ldquo;working set&amp;rdquo;. After recently chipping in on another StackOverflow question on the subject of &amp;ldquo;What does it meant to fit &amp;lsquo;working set&amp;rsquo; in RAM?&amp;rdquo;, I thought it was a good subject for a blog post. This is really just a copy and extension of my input on that question and focused in certain parts on MongoDB, but is also as relevant to other databases.</description></item><item><title>OS Data Importer Supports Scale Gazetteer Dataset</title><link>https://www.adathedev.co.uk/2011/03/os-data-importer-supports-scale.html</link><pubDate>Sun, 27 Mar 2011 21:54:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2011/03/os-data-importer-supports-scale.html</guid><description>I&amp;rsquo;ve just pushed some updates to GitHub for the Ordnance Survey Data Importer .NET app I&amp;rsquo;ve been working on every now and then (see my previous posts: GB Post Code Geographic Data Load to SQL Server using .NET and OS CodePoint Data Geography Load Update).
Aside from a little re-jigging to potentially pave the way to load more Ordnance Survey data files to SQL Server in the future, it now supports importing the 1:50000 Scale Gazetteer data file to SQL Server (available to download from here).</description></item><item><title>Thoughts on MongoDB from a SQL Server Dev</title><link>https://www.adathedev.co.uk/2011/02/thoughts-on-mongodb-from-sql-server-dev.html</link><pubDate>Fri, 25 Feb 2011 14:20:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2011/02/thoughts-on-mongodb-from-sql-server-dev.html</guid><description>As someone with a background in SQL Server development dating back to 2000, the whole NoSQL jazz has been something that&amp;rsquo;s been on the radar for a while but never made it under the microscope so to speak. Partly because SQL Server is my comfort zone and there&amp;rsquo;s plenty more to still learn about that; partly because I&amp;rsquo;ve had my career mapped out in my head and NoSQL didn&amp;rsquo;t feature much in that vision; partly because until you have something real-world driving a push into a technology then you tend to have that technology remaining as a distant dot on the radar.</description></item><item><title>OS CodePoint Data Geography Load Update</title><link>https://www.adathedev.co.uk/2011/02/os-codepoint-data-geography-load-update.html</link><pubDate>Sun, 13 Feb 2011 19:07:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2011/02/os-codepoint-data-geography-load-update.html</guid><description>Following on from my previous post on loading the Ordnance Survey Code-Point data for GB post codes to SQL Server and converting to the GEOGRAPHY data type, I&amp;rsquo;ve made a few tweaks to the importer app that is up on GitHub:
The schema of the SQL Server table generated has changed - postcodes are now split into 2 distinct columns: OutwardCode and InwardCode The importer now calculates a basic average for each postcode district (e.</description></item><item><title>MongoDB - Does My Data Look Big In This?</title><link>https://www.adathedev.co.uk/2011/02/mongodb-does-my-data-look-big-in-this.html</link><pubDate>Mon, 07 Feb 2011 10:10:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2011/02/mongodb-does-my-data-look-big-in-this.html</guid><description>You have an existing relational database containing x amount of data and you decide to migrate that data, for whatever reason, into MongoDB. You may have an pre-conceived belief that as your relational database is x GB in size, that after loading that data into MongoDB your NoSQL database size will be around about x GB too - after all, you&amp;rsquo;re loading exactly the same data from one to the other right?</description></item><item><title>GB Post Code Geographic Data Load to SQL Server using .NET</title><link>https://www.adathedev.co.uk/2011/01/gb-post-code-geographic-data-load-to.html</link><pubDate>Mon, 24 Jan 2011 08:38:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2011/01/gb-post-code-geographic-data-load-to.html</guid><description>Ordnance Survey now make available a number of mapping data/geographic datasets to download for free, allowing unrestricted use for commercial and non-commercial use. One of these is the Code-Point Open dataset, which gives a precise geographic location of each post code in Great Britain as a CSV file.
This file contains the Easting and Northing coordinates for each postcode. You may want to convert these to Latitude/Longitude coordinates to then load into a GEOGRAPHY column in SQL Server (as of 2008) and do all kinds of spatial wizardry in the database.</description></item><item><title>SqlBulkCopy to SQL Server in Parallel</title><link>https://www.adathedev.co.uk/2011/01/sqlbulkcopy-to-sql-server-in-parallel.html</link><pubDate>Wed, 12 Jan 2011 10:32:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2011/01/sqlbulkcopy-to-sql-server-in-parallel.html</guid><description>In an earlier post last year, I blogged about high performance bulk loading to SQL Server from .NET using SqlBulkCopy. That post highlighted the performance gain that SqlBulkCopy gives over another batched insert approach using an SqlDataAdapter. But is it possible to squeeze more performance out? Oh yes.
First, a quick recap. For optimal performance:
load into a heap table (with no indexes - add any indexes you need AFTER you&amp;rsquo;ve loaded the data)</description></item><item><title>GROUPING SETS in SQL Server</title><link>https://www.adathedev.co.uk/2011/01/grouping-sets-in-sql-server.html</link><pubDate>Mon, 10 Jan 2011 12:09:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2011/01/grouping-sets-in-sql-server.html</guid><description>Something I personally haven&amp;rsquo;t seen a lot of out there in the SQL Server world, is use of GROUPING SETS - an operator that can be applied in a GROUP BY clause. So what does it do? How would you use it?
Take the AdventureWorks sample database as an example playground. Suppose you want to query the sales data to find the following:
total sales for each product total sales for each product category total sales There&amp;rsquo;s a number of ways you could do this.</description></item><item><title>Round up of 2010</title><link>https://www.adathedev.co.uk/2010/12/round-up-of-2010.html</link><pubDate>Thu, 30 Dec 2010 21:36:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/12/round-up-of-2010.html</guid><description>2010 was my first year as a blogger, after finally pulling my finger out back in February. I learnt an early lesson in naming/tagging posts appropriately after my first search engine hits came in via the term &amp;ldquo;pull my finger&amp;rdquo;. Not exactly the kind of search term I was hoping to bring up my site - things have improved now so I&amp;rsquo;ve headed in the right direction with a focus on SQL Server and .</description></item><item><title>SQLSoton UserGroup Jan 2011</title><link>https://www.adathedev.co.uk/2010/12/sqlsoton-usergroup-jan-2011.html</link><pubDate>Sun, 19 Dec 2010 21:03:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/12/sqlsoton-usergroup-jan-2011.html</guid><description>After the success of the first ever SQL Server Southampton UserGroup this month, the next is planned for Wednesday 19th January 2011 with Christian Bolton (Blog| Twitter) doing a talk on &amp;ldquo;Exploring SQL Server&amp;rsquo;s Architecture&amp;rdquo;. Followed by SQL Supper - a chance to eat pizza and discuss anything SQL Server related. Got a niggle at work you&amp;rsquo;d like 2nd/3rd/nth opinions on? Perfect opportunity. Just want to network and have a casual chat?</description></item><item><title>SQL Server Southampton UserGroup</title><link>https://www.adathedev.co.uk/2010/12/sql-server-southampton-usergroup.html</link><pubDate>Thu, 09 Dec 2010 08:15:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/12/sql-server-southampton-usergroup.html</guid><description>Last night was the first SQL Server Southampton UserGroup (#sqlsoton for those on twitter) organised by Mark Pryce-Maher (Twitter | Blog). It&amp;rsquo;s a difficult job trying to get a local usergroup up and running especially when it&amp;rsquo;s difficult to reach out to local professionals and get a firm idea of who&amp;rsquo;s going to come, and so credit to Mark for making it happen.
Cap&amp;rsquo;n, we have no power Despite projector/power lead problems (and there being a million and one kettles in the hired room, none with suitable lead!</description></item><item><title>SQLBits 6 videos available</title><link>https://www.adathedev.co.uk/2010/10/sqlbits-6-videos-available.html</link><pubDate>Thu, 21 Oct 2010 08:20:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/10/sqlbits-6-videos-available.html</guid><description>First tweet I say today was a great one - the SQLBits 6 videos are now available. Good news from Simon Sabin (Blog | Twitter) - thanks once again, and to the whole SQLBits team.
If you were there, then no doubt you&amp;rsquo;re like me and keen to either catch the sessions you didn&amp;rsquo;t attend or re-watch some sessions you did attend.
If you weren&amp;rsquo;t there, then even more reason to check them out (list of sessions).</description></item><item><title>SSMS Tools Pack</title><link>https://www.adathedev.co.uk/2010/10/ssms-tools-pack.html</link><pubDate>Wed, 20 Oct 2010 20:40:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/10/ssms-tools-pack.html</guid><description>Today I downloaded and installed the SSMS Tools Pack, a free add-in for SQL Server Management Studio developed by Mladen Prajdić (Blog | Twitter).
Late to the party&amp;hellip;and not even fashionably late Yes I know, I know - everyone uses the SSMS Tools Pack and I&amp;rsquo;m well aware I&amp;rsquo;m late to the party! Fail whale on my part. It&amp;rsquo;s one of those things I bookmarked a long time ago and just never got round to actually trying out.</description></item><item><title>Long time no post</title><link>https://www.adathedev.co.uk/2010/10/long-time-no-post.html</link><pubDate>Mon, 18 Oct 2010 17:14:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/10/long-time-no-post.html</guid><description>It&amp;rsquo;s been a while since my last blog post, with good reason as September saw the arrival of my first child - a beautiful baby girl. It did mean I had to miss SQLBits 7 up in York, but of course that pales into insignificance when comparing to becoming a Dad for the first time! Besides, there&amp;rsquo;s always SQLBits 8&amp;hellip;(cough bring it to the south coast! cough). Now I&amp;rsquo;m back at work after paternity leave and I&amp;rsquo;m starting to get back in the swing of things.</description></item><item><title>Passing a TABLE variable into dynamic SQL</title><link>https://www.adathedev.co.uk/2010/08/passing-table-variable-into-dynamic-sql.html</link><pubDate>Tue, 10 Aug 2010 19:55:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/08/passing-table-variable-into-dynamic-sql.html</guid><description>A question popped up on StackOverflow today, asking how to pass a TABLE variable into a dynamic SQL statement in SQL Server 2008. I&amp;rsquo;ve previously blogged about table-valued parameters, comparing the approach of passing in a TABLE of values to a stored procedure to the techniques you&amp;rsquo;d have had to use in earlier versions of SQL Server (e.g. CSV or XML), but this specific question is worth a quick follow-up.</description></item><item><title>Validating an SQL query programmatically, with gotcha</title><link>https://www.adathedev.co.uk/2010/07/validating-sql-query-programmatically.html</link><pubDate>Thu, 01 Jul 2010 22:31:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/07/validating-sql-query-programmatically.html</guid><description>If you want to check the validity of a TSQL statement programmatically, you can make use of the SET NOEXEC statement. As this MSDN reference states, SET NOEXEC ON will compile the query but won&amp;rsquo;t actually execute it. This is ideal (well, nearly&amp;hellip;.) if perhaps you have a dynamically generated statement that you want to check is valid before executing it.
Example time SET NOEXEC ON GO SELECT TOP * FROM sys.</description></item><item><title>The SQL Server MasterClass Experience</title><link>https://www.adathedev.co.uk/2010/06/sql-server-masterclass-experience.html</link><pubDate>Fri, 18 Jun 2010 22:18:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/06/sql-server-masterclass-experience.html</guid><description>SQL Server MasterClass 2010 was a very high quality, one day event presented by Paul S. Randal (Twitter | Blog) and Kimberly L. Tripp (Twitter | Blog) - not that they need any introduction of course. In fact if you don&amp;rsquo;t know of them, then perhaps you should close down your SSMS window and switch off your machine - after reading my blog of course :). Maybe uninstall SQL Server too&amp;hellip;</description></item><item><title>SQL Server XML datatype with CDATA</title><link>https://www.adathedev.co.uk/2010/06/sql-server-xml-datatype-with-cdata.html</link><pubDate>Mon, 14 Jun 2010 14:06:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/06/sql-server-xml-datatype-with-cdata.html</guid><description>So today I learnt something new - it turns out the XML datatype in SQL Server does not preserve CDATA sections.
e.g.
DECLARE @XML XML SET @XML = &amp;#39;&amp;lt;Test&amp;gt;&amp;lt;NodeA&amp;gt;&amp;lt;![CDATA[Testing cdata section &amp;lt;woop!&amp;gt;]]&amp;gt;&amp;lt;/NodeA&amp;gt;&amp;lt;/Test&amp;gt;&amp;#39; SELECT @XML Results ------------------------------------------------------------------ &amp;lt;Test&amp;gt;&amp;lt;NodeA&amp;gt;Testing cdata section &amp;amp;lt;woop!&amp;amp;gt;&amp;lt;/NodeA&amp;gt;&amp;lt;/Test&amp;gt; After a quick dig around, I found this MS Connect case. I personally would like to see it accept whatever you pass in without silently altering it, as long as it&amp;rsquo;s well-formed XML of course.</description></item><item><title>Optimising wildcard prefixed LIKE conditions</title><link>https://www.adathedev.co.uk/2010/05/optimising-like-conditions-with.html</link><pubDate>Wed, 26 May 2010 08:41:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/05/optimising-like-conditions-with.html</guid><description>Suppose you want to write a query to find all products in your database that have a name beginning with &amp;ldquo;Long-Sleeve&amp;rdquo;. You&amp;rsquo;d more than likely use something like below (examples based on AdventureWorks LT sample database):
SELECT name FROM SalesLT.Product WHERE name LIKE &amp;#39;Long-Sleeve%&amp;#39; This produces a good execution plan, performing an index seek on the nonclustered index that exists on the name column. If you look at the seek operation, you&amp;rsquo;ll see the query optimiser has done a good job of ensuring an index can be used by looking at the seek predicate:</description></item><item><title>Rise of the SQL Server DevBA</title><link>https://www.adathedev.co.uk/2010/03/rise-of-sql-server-devba.html</link><pubDate>Thu, 04 Mar 2010 21:30:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/03/rise-of-sql-server-devba.html</guid><description>Something that has got me thinking recently is the distinction between an SQL Server Developer and a DBA. I imagine that most people would describe themselves as one or the other exclusively. My CV for example says I&amp;rsquo;m a developer - that is what I am. I would never market myself as a DBA; aside from the fact I just don&amp;rsquo;t have the full skillset of a DBA, it would just be an insult to the real DBAs out there whose knowledge and experience in that arena far outweighs mine.</description></item><item><title>Queue table processing in SQL Server</title><link>https://www.adathedev.co.uk/2010/03/queue-table-processing-in-sql-server.html</link><pubDate>Mon, 01 Mar 2010 22:27:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/03/queue-table-processing-in-sql-server.html</guid><description>Implementing SQL Server queue table processing logic is something I keep meaning to blog about and finally I&amp;rsquo;ve got round to it thanks to my memory being jogged by StackOverflow questions I&amp;rsquo;ve recently participated in, including this one. The scenario is you queue up records in a database table, each representing a piece of work needing to be done. You then want to have processes that periodically poll this table to pick up the next item of work from the queue and process them.</description></item><item><title>Changing primary key index structure</title><link>https://www.adathedev.co.uk/2010/03/changing-primary-key-index-structure.html</link><pubDate>Mon, 01 Mar 2010 08:00:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/03/changing-primary-key-index-structure.html</guid><description>Changing the structure of a primary key constraint index from nonclustered to clustered (or from clustered to nonclustered) is not necessarily as straight forward as it first seems. The process of changing it over, involves the constraint being dropped and then recreated. This could potentially cause a problem if you&amp;rsquo;re making the change on a table whilst there could be activity against it.
Example
TableX was originally created as below:</description></item><item><title>SQLBits VI - Upcoming SQL Server event</title><link>https://www.adathedev.co.uk/2010/02/sqlbits-vi-upcoming-sql-server-event.html</link><pubDate>Thu, 25 Feb 2010 20:32:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/02/sqlbits-vi-upcoming-sql-server-event.html</guid><description>SQLBits VI is scheduled in my calendar for Friday 16th April - and I&amp;rsquo;m expecting great things! It&amp;rsquo;s a 1 day, SQL Server event being held in London (Westminster to be semi-precise), and the theme is performance and scalability which, as I mentioned in an earlier blog post, is particularly high on my agenda at the moment.
Not only does it offer high quality speakers, but it&amp;rsquo;s a free event too.</description></item><item><title>Autogenerated SQL constraint names - why to avoid them</title><link>https://www.adathedev.co.uk/2010/02/autogenerated-sql-constraint-names-why.html</link><pubDate>Tue, 23 Feb 2010 21:42:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/02/autogenerated-sql-constraint-names-why.html</guid><description>Autogenerated constraint names in SQL Server - are they convenient, or are they a hindrance? For me, they are a hindrance.
Why should I care that SQL Server autogenerates a constraint name when I don&amp;rsquo;t explicitly specify one? Why does it matter if it names my PRIMARY KEY constraint &amp;ldquo;PK__Constrai__3214EC271FCDBCEB&amp;rdquo;, or my DEFAULT constraint &amp;ldquo;DF__Constraint__ColumnA__21B6055D&amp;rdquo;?
Why should I name each constraint myself and not rely on autogenerated constraint names?
Because it makes maintenance and database update deployments easier, simpler and in my opinion, safer.</description></item><item><title>Optimising date filtered SQL queries</title><link>https://www.adathedev.co.uk/2010/02/optimising-date-filtered-sql-queries.html</link><pubDate>Sun, 21 Feb 2010 16:55:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/02/optimising-date-filtered-sql-queries.html</guid><description>How you structure your SQL queries is very important and choosing the wrong approach can have big effects on the performance of the query.
One of the key things that should flag up the potential for needing optimisation, is if you are using a function/calculation within a WHERE clause. These can lead to inefficient execution plans, preventing sub-optimal index use.
A classic example to demonstrate this is when querying the data for a specific month.</description></item><item><title>Using the SP:StmtCompleted SQL Profiler trace event class</title><link>https://www.adathedev.co.uk/2010/02/stmtcompleted-sql-profiler-trace-event.html</link><pubDate>Wed, 17 Feb 2010 22:42:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/02/stmtcompleted-sql-profiler-trace-event.html</guid><description>One question I&amp;rsquo;ve seen popping up a few times recently, is how to check what individual statement(s) within an SQL Server stored procedure are taking the most time.
The scenario is that there is a stored procedure that consists of a number of SQL statements. The stored procedure has been flagged up as running slower than perhaps it was expected to, but as there are a number of statements/queries within it, it&amp;rsquo;s not immediately clear where the time is being taken.</description></item><item><title>High performance bulk loading to SQL Server using SqlBulkCopy</title><link>https://www.adathedev.co.uk/2010/02/sqlbulkcopy-bulk-load-to-sql-server.html</link><pubDate>Mon, 15 Feb 2010 21:24:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/02/sqlbulkcopy-bulk-load-to-sql-server.html</guid><description>If you ever want to bulk load data into an SQL Server database as quickly as possible, the SqlBulkCopy class is your friend (in the System.Data.SqlClient namespace). Since being introduced in .NET 2.0, it has provided an extremely efficient way to bulk load data into SQL Server, and is one the classes that I see as a &amp;ldquo;must know about&amp;rdquo;. A usual scenario is where you want to dump some data into the database to then do some processing on.</description></item><item><title>QCon London 2010</title><link>https://www.adathedev.co.uk/2010/02/qcon-london-2010.html</link><pubDate>Wed, 10 Feb 2010 21:00:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/02/qcon-london-2010.html</guid><description>So QCon London is fast approaching, starting with 2 days of tutorials on the 8th and 9th of March, then the 3 day conference from 10th-12th. This will be my first time at QCon and I&amp;rsquo;m really looking forward to it. Having never been to many conferences in the past, the level of expectation I have is solely based on the StackOverflow DevDay in London last October. That was a great day with some very interesting (and humorous) talks, so I&amp;rsquo;m expecting even better things from QCon as it&amp;rsquo;s reputation precedes it!</description></item><item><title>Would you like SQL cache with that?</title><link>https://www.adathedev.co.uk/2010/02/would-you-like-sql-cache-with-that.html</link><pubDate>Tue, 09 Feb 2010 19:32:00 +0000</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/02/would-you-like-sql-cache-with-that.html</guid><description>One of the things I feel I keep badgering on about in the world of SQL Server and query tuning is to be fair and consistent when comparing the different possible variants. If you don&amp;rsquo;t level the playing field, then potentially it will lead to you thinking a particular query out-performs another when in fact the opposite could be true. It&amp;rsquo;s a bit like comparing 2 paper boys to see which one can complete a given round the quickest - if one of them has been doing the round for the past 2 weeks but the other has never done that round before, then are you going to be able to reliably tell which one is actually quickest?</description></item></channel></rss>