<?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-7126569487905400170</id><updated>2011-08-01T12:18:33.745-07:00</updated><title type='text'>DBA Flash</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dbaflash.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dbaflash.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Brennan Gordon</name><uri>http://www.blogger.com/profile/09731640891944351507</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>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7126569487905400170.post-1762764916311432470</id><published>2008-08-06T16:23:00.000-07:00</published><updated>2008-08-07T01:26:41.143-07:00</updated><title type='text'>The power of ROW_NUMBER()</title><content type='html'>&lt;div class="ExternalClassF74139D097D240B79AC84F7E992C2A00"&gt;Ever since I heard Itzak Ben-Gan talk about the awesome capability of the ROW_NUMBER() function in 2005 I have been waiting for an opportunity to solve a TSQL challenge by using it; today I got the opportunity.&lt;br /&gt;&lt;br /&gt;I have a table with a million records that contains a record for each account held by a whole range of companies; and there is usually more than one and as many as 50 records per company.&lt;br /&gt;&lt;br /&gt;The challenge is to write a TSQL statement that returns a single record per company with a column for each account - essentially pivoting the table on the account numbers and naming the columns [Account 1],...[Account n].&lt;br /&gt;&lt;br /&gt;Here is my solution and as you can see I use the ROW_NUMBER() function not only to partition the company data but also to generate a recordset for numbers to dynamically build the TSQL statement. I also made use of two other 2005 features: the nvarchar(max) datatype and the TOP(@variable).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#008000;"&gt;--add the variable to determine how many account columns we need&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:blue;"&gt;DECLARE&lt;/span&gt; &lt;span lang="EN-US"  style="font-family:'Courier New';"&gt;@AccountColumns &lt;span style="color:blue;"&gt;int&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:blue;"&gt;SET&lt;/span&gt; &lt;span lang="EN-US"  style="font-family:'Courier New';"&gt;@AccountColumns &lt;span style="color:gray;"&gt;=&lt;/span&gt; 50&lt;span style="color:gray;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:gray;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:blue;"&gt;&lt;span style="font-size:85%;color:#008000;"&gt;--define the case statement template for each column&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:blue;"&gt;DECLARE&lt;/span&gt;&lt;span lang="EN-US"  style="font-family:'Courier New';"&gt; @AccountColumnSQL &lt;span style="color:blue;"&gt;nvarchar&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;255&lt;span style="color:gray;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:blue;"&gt;SET&lt;/span&gt;&lt;span lang="EN-US"  style="font-family:'Courier New';"&gt; @AccountColumnSQL &lt;span style="color:gray;"&gt;=&lt;/span&gt; N&lt;span style="color:red;"&gt;',MAX(CASE WHEN SQ.[Row] = #No# THEN SQ.[Account] END) AS ''Account #No#'''&lt;/span&gt;&lt;span style="color:gray;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:gray;"&gt;&lt;span style="font-size:85%;color:#008000;"&gt;&lt;br /&gt;&lt;p&gt;--use the sys.objects table to generate a recordset of sequential numbers from 1 to n&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:blue;"&gt;DECLARE&lt;/span&gt;&lt;span lang="EN-US"  style="font-family:'Courier New';"&gt; @AccountColumnList &lt;span style="color:blue;"&gt;nvarchar&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;max&lt;/span&gt;&lt;span style="color:gray;"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:blue;"&gt;SELECT&lt;/span&gt;&lt;span lang="EN-US"  style="font-family:'Courier New';"&gt; @AccountColumnList &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:gray;"&gt;(&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"  style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt; &lt;span style="color:blue;"&gt;TOP&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;@AccountColumns&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;REPLACE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;@AccountColumnSQL&lt;span style="color:gray;"&gt;,&lt;/span&gt;&lt;span style="color:red;"&gt;'#No#'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;ROW_NUMBER&lt;/span&gt;&lt;span style="color:gray;"&gt;()&lt;/span&gt; &lt;span style="color:blue;"&gt;OVER&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:blue;"&gt;ORDER&lt;/span&gt; &lt;span style="color:blue;"&gt;BY&lt;/span&gt; [object_id]&lt;span style="color:gray;"&gt;))&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"  style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;FROM&lt;/span&gt; &lt;span style="color:green;"&gt;sys.objects&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"  style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;FOR&lt;/span&gt; &lt;span style="color:blue;"&gt;XML&lt;/span&gt; &lt;span style="color:blue;"&gt;PATH&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;''&lt;/span&gt;&lt;span style="color:gray;"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:gray;"&gt;);&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:gray;"&gt;&lt;span style="font-size:85%;color:#008000;"&gt;&lt;br /&gt;&lt;p&gt;--define the query to produce the pivoted values&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:blue;"&gt;DECLARE&lt;/span&gt;&lt;span lang="EN-US"  style="font-family:'Courier New';"&gt; @AccountQuery &lt;span style="color:blue;"&gt;nvarchar&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;max&lt;/span&gt;&lt;span style="color:gray;"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:blue;"&gt;SET&lt;/span&gt;&lt;span lang="EN-US"  style="font-family:'Courier New';"&gt; @AccountQuery &lt;span style="color:gray;"&gt;=&lt;/span&gt; N&lt;span style="color:red;"&gt;'&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;SELECT&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;[Id]&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;,[Name]&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;'&lt;/span&gt;&lt;span lang="EN-US"  style="font-family:'Courier New';"&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; @AccountColumnList &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;'&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;FROM (&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;SELECT&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;[Id]&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;,[CompanyName]&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;,[Account]&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;,ROW_NUMBER() OVER(PARTITION BY [Id] ORDER BY [Id] DESC) AS ''Row''&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;FROM [dbo].[CompanyAccounts]&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;) AS SQ&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;GROUP BY&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;[Id]&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:red;"&gt;,[Name]'&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:gray;"&gt;;&lt;/span&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:blue;"&gt;EXEC&lt;/span&gt;&lt;span lang="EN-US"   style="font-family:'Courier New';color:gray;"&gt;(&lt;/span&gt;&lt;span lang="EN-US"  style="font-family:'Courier New';"&gt;@AccountQuery&lt;span style="color:gray;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;And that's it. The query returned 1 million records with 52 columns in 1min 11sec...nice!&lt;br /&gt;&lt;br /&gt;If you are wondering why I didn't use the PIVOT statement rather than the CASE it because I couldn't get it to work and also because BG (that's Ben-Gan) suggested that there was no significant advantage to using it other than neatness. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7126569487905400170-1762764916311432470?l=dbaflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbaflash.blogspot.com/feeds/1762764916311432470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7126569487905400170&amp;postID=1762764916311432470' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/1762764916311432470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/1762764916311432470'/><link rel='alternate' type='text/html' href='http://dbaflash.blogspot.com/2008/08/power-of-rownumber.html' title='The power of ROW_NUMBER()'/><author><name>Brennan Gordon</name><uri>http://www.blogger.com/profile/09731640891944351507</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7126569487905400170.post-328380694991237579</id><published>2008-08-06T05:20:00.000-07:00</published><updated>2008-08-06T05:33:35.325-07:00</updated><title type='text'>CLR Bug</title><content type='html'>Ok, I did a backup of a db, that contained CLR procs, and then restored it with another name; set the database trust:&lt;br /&gt;&lt;br /&gt;ALTER DATABASE [MyDb] SET TRUSTWORTHY ON;&lt;br /&gt;&lt;br /&gt;...executed a CLR proc and here is what SQL gave me:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;color:#ff0000;"&gt;Msg 10314, Level 16, State 11, Line 1&lt;br /&gt;An error occurred in the Microsoft .NET Framework while trying to load assembly id 66426. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error:&lt;br /&gt;System.IO.FileLoadException: Could not load file or assembly 'ciqapplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Exception from HRESULT: 0x80FC80F1&lt;br /&gt;System.IO.FileLoadException:&lt;br /&gt;   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&amp;amp; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)&lt;br /&gt;   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark&amp;amp; stackMark, Boolean forIntrospection)&lt;br /&gt;   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp;amp; stackMark, Boolean forIntrospection)&lt;br /&gt;   at System.Reflection.Assembly.Load(String assemblyString)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Thankfully it was an easy one to fix (see MSKB: &lt;a href="http://support.microsoft.com/kb/918040"&gt;http://support.microsoft.com/kb/918040&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;I changed the db owner to sa:&lt;br /&gt;&lt;br /&gt;USE [MyDb];&lt;br /&gt;GO&lt;br /&gt;EXEC sp_changedbowner 'sa';&lt;br /&gt;&lt;br /&gt;...and it now works. Turns out that there is an issue the db owner not having a specific login on the server, even though my access was granted via a group login.&lt;br /&gt;&lt;br /&gt;Sure, you could have figured this out with google but it did seem a nice nugget to blog about.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7126569487905400170-328380694991237579?l=dbaflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbaflash.blogspot.com/feeds/328380694991237579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7126569487905400170&amp;postID=328380694991237579' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/328380694991237579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/328380694991237579'/><link rel='alternate' type='text/html' href='http://dbaflash.blogspot.com/2008/08/clr-bug.html' title='CLR Bug'/><author><name>Brennan Gordon</name><uri>http://www.blogger.com/profile/09731640891944351507</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-7126569487905400170.post-6694966543846390203</id><published>2008-08-01T03:35:00.000-07:00</published><updated>2008-08-01T03:58:53.607-07:00</updated><title type='text'>Db Unit Testing: Intro</title><content type='html'>One of the most exciting features of DbPro (Visual Studio Team Edition for Database Professionals) is the unit test - see &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc164243(printer).aspx"&gt;here&lt;/a&gt; for a really good intro from Jamie Lafen. The reason I think this is so exciting is because it brings the world of database development into the same arena as the rest of software development on the microsoft platform; for so long the two disciplines have been miles apart with development techniques and procedures being completely different.&lt;br /&gt;&lt;br /&gt;But with the introduction of the database project and also with the database unit test we can now start to treat database development the same way we treat software development. Both should be adhering to the same methodology and striving to achieve the same goals of quality, robustness and agility.&lt;br /&gt;&lt;br /&gt;Well, these are all just words and what I really want to say is that I want to be able to treat a stored procedure or function with the same respect that I would a method or interface in C#. I want to have a test rig that I can attach to a database nightly build that can give me the confidence that the T-SQL I have added does not invalidate any of the existing schema and that my code still works, end-to-end. And most importantly, I want this to happen automatically each night without me having to sit for ages executing test scripts that only work for me.&lt;br /&gt;&lt;br /&gt;So, my adventures into &lt;a href="http://www.agiledata.org/essays/tdd.html"&gt;TDDD&lt;/a&gt; begins here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7126569487905400170-6694966543846390203?l=dbaflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbaflash.blogspot.com/feeds/6694966543846390203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7126569487905400170&amp;postID=6694966543846390203' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/6694966543846390203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/6694966543846390203'/><link rel='alternate' type='text/html' href='http://dbaflash.blogspot.com/2008/08/db-unit-testing-intro.html' title='Db Unit Testing: Intro'/><author><name>Brennan Gordon</name><uri>http://www.blogger.com/profile/09731640891944351507</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-7126569487905400170.post-1355005762170515063</id><published>2008-07-28T05:35:00.000-07:00</published><updated>2008-07-28T05:38:16.906-07:00</updated><title type='text'>Common Collation Conflict</title><content type='html'>Whenever you access database schema outside the scope of the current database there is a chance that you will run into a collation conflict error. Most of the instances of this error that I have encountered have been caused by remote databases using the older SQL collation (SQL_Latin1_General_CP1_CI_AS) instead of the windows collation (Latin1_General_CI_AS).&lt;br /&gt;&lt;br /&gt;Because these two collations use the Latin1 (ANSI) code page and have the same sort orders (CI_AS), there is no harm in changing from one to the other in a conflict scenario.&lt;br /&gt;&lt;br /&gt;Consider the following query:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;SELECT&lt;/span&gt; cur.[Column1]&lt;br /&gt;&lt;span style="color:#000099;"&gt;FROM&lt;/span&gt; [dbo].[Table1] &lt;span style="color:#000099;"&gt;AS&lt;/span&gt; cur&lt;br /&gt;&lt;span style="color:#666666;"&gt;INNER JOIN&lt;/span&gt; [RemoteServer].[RemoteDb].[dbo].[Table1] &lt;span style="color:#000099;"&gt;AS&lt;/span&gt; rem    &lt;br /&gt;      &lt;span style="color:#000099;"&gt;ON&lt;/span&gt; (rem.[Column1] = cur.[Column1]);&lt;br /&gt;&lt;br /&gt;This produces the following error because the remote table column has been defined using the SQL collation.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;Msg 468, Level 16, State 9, Line 1&lt;br /&gt;Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To resolve this problem, we could simply add the COLLATE statement to convert to the local Windows collation.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;SELECT&lt;/span&gt; cur.[Column1]&lt;br /&gt;&lt;span style="color:#000099;"&gt;FROM&lt;/span&gt; [dbo].[Table1] &lt;span style="color:#000099;"&gt;AS&lt;/span&gt; cur&lt;br /&gt;&lt;span style="color:#666666;"&gt;INNER JOIN&lt;/span&gt; [RemoteServer].[RemoteDb].[dbo].[Table1]&lt;span style="color:#000099;"&gt; AS&lt;/span&gt; rem&lt;br /&gt;     &lt;span style="color:#000099;"&gt;ON&lt;/span&gt; (rem.[Column1] COLLATE Latin1_General_CI_AS = cur.[Column1]);&lt;br /&gt;&lt;br /&gt;However, there is another way; a linked server can be configured to ignore remote collations by changing the "Use Remote Collation" Server Option to FALSE. This is a far cleaner, simpler way to handle collation conflicts where linked servers are involved.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7126569487905400170-1355005762170515063?l=dbaflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbaflash.blogspot.com/feeds/1355005762170515063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7126569487905400170&amp;postID=1355005762170515063' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/1355005762170515063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/1355005762170515063'/><link rel='alternate' type='text/html' href='http://dbaflash.blogspot.com/2008/07/common-collation-conflict.html' title='Common Collation Conflict'/><author><name>Brennan Gordon</name><uri>http://www.blogger.com/profile/09731640891944351507</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-7126569487905400170.post-1396805980845796688</id><published>2008-07-28T05:33:00.000-07:00</published><updated>2008-07-28T05:35:01.908-07:00</updated><title type='text'>Microsoft buys DATAllegro</title><content type='html'>Firstly, I don’t know much about  DatAllegro, other than the fact that their product is an enterprise Data Warehouse solution. A colleague of mine told me about the acquisition (&lt;a href="http://www.datallegro.com/pr/7_24_08_microsoft_acquisition.asp"&gt;http://www.datallegro.com/pr/7_24_08_microsoft_acquisition.asp&lt;/a&gt;) this morning. What I think is significant is that MS is continuing to grow its database platform and that is good news for SQL Professionals. The way I look at it is that if SQL grows, I will grow with it and somewhere down the line my job description and skill-set become far more valuable. That can only be a good thing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7126569487905400170-1396805980845796688?l=dbaflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbaflash.blogspot.com/feeds/1396805980845796688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7126569487905400170&amp;postID=1396805980845796688' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/1396805980845796688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/1396805980845796688'/><link rel='alternate' type='text/html' href='http://dbaflash.blogspot.com/2008/07/microsoft-buys-datallegro.html' title='Microsoft buys DATAllegro'/><author><name>Brennan Gordon</name><uri>http://www.blogger.com/profile/09731640891944351507</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-7126569487905400170.post-2877127085874574515</id><published>2008-07-25T02:35:00.000-07:00</published><updated>2008-07-31T05:08:02.797-07:00</updated><title type='text'>To Blog or not to Blog</title><content type='html'>I have been convinced by one my &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;colleagues, Matt (&lt;a href="http://cubisbi.blogspot.com/"&gt;http://cubisbi.blogspot.com/&lt;/a&gt;)&lt;/span&gt; that it would be a good idea to start a blog for a wider &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;audience&lt;/span&gt; than our corporate environment; this after posting internally for nearly a year now.&lt;br /&gt;&lt;br /&gt;My focus is &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;SQL&lt;/span&gt; Server and Visual Studio for Database &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Pro's&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Hope you get some sort of value from the blog.&lt;br /&gt;&lt;br /&gt;Cheers&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;BG&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7126569487905400170-2877127085874574515?l=dbaflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbaflash.blogspot.com/feeds/2877127085874574515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7126569487905400170&amp;postID=2877127085874574515' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/2877127085874574515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7126569487905400170/posts/default/2877127085874574515'/><link rel='alternate' type='text/html' href='http://dbaflash.blogspot.com/2008/07/to-blog-or-not-to-blog.html' title='To Blog or not to Blog'/><author><name>Brennan Gordon</name><uri>http://www.blogger.com/profile/09731640891944351507</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>
